Nothing is working but it is on the right track! ASYNCIFY removed, manual waiting instead and some proxying logic

This commit is contained in:
msqr1
2024-01-28 00:09:16 -08:00
parent efb56e19f9
commit 8796f35445
22 changed files with 239 additions and 7375 deletions

View File

@@ -1,24 +1,30 @@
#pragma once
#include "global.h"
#include <string>
#include <filesystem>
#include <fstream>
#include <thread>
#include <fcntl.h>
#include <vosk_api.h>
#include <archive.h>
#include <archive_entry.h>
#include <emscripten/wasmfs.h>
#include <emscripten.h>
extern void throwJS(const char* msg, bool err = false);
extern void throwJS(const char* msg, bool err);
namespace fs = std::filesystem;
struct genericModel {
const std::string url{};
const std::string id{};
static bool extractModel(char *name);
static bool extractModel();
static bool checkId(const std::string& id);
virtual bool checkModel() = 0;
bool loadModel(const std::string& storepath);
genericModel(const std::string &url, const std::string &storepath, const std::string &id);
};
struct fetchData {
const std::string storepath{};
std::atomic_flag* blocker{};
bool* successful{};
genericModel* self{};
fetchData(const std::string& storepath, bool* successful, std::atomic_flag* blocker, genericModel* self);
};