arudradey/ml-cpu-storage / emsdk /upstream /emscripten /test /embind_with_asyncify.cpp
arudradey's picture
download
raw
435 Bytes
#include <assert.h>
#include <string>
#include <emscripten.h>
#include <emscripten/val.h>
using namespace emscripten;
int main() {
val fetch = val::global("fetch");
std::string url = "data:text/plain,foo";
val async_response = fetch(url);
val response = async_response.await();
val async_text = response.call<val>("text");
std::string text = async_text.await().as<std::string>();
assert(text == "foo");
return 0;
}

Xet Storage Details

Size:
435 Bytes
·
Xet hash:
10236827b4e765e2f846f0070bb64d564099cd163ff9edd3df4350129a45f10b

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.