You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, it would be nice if instead of eagerly loading the binary library synchronously deno_bindgen would export a function called something like load which would be a function that does Deno.dlopen and attaches all of the helper functions to an object that is returned. Therefore, people could instantiate multiple instances of their library in cases where there is different state that they want instead of having to write multiple awkward dynamic imports. Also, it would help when enabling testing and benchmarking in sub libraries that use deno bindgen to not always need to wait for the synchronous Deno.dlopen call to finish at the start of each run when it may not be needed.
The text was updated successfully, but these errors were encountered:
Maybe even export a function named attach which takes in a Deno.DynamicLibrary<T> and then creates the object with the methods generated from the bindgen and returns it. Then, we could still export a load function but make it simply consist of the following:
exportfunctionload(){constlib=Deno.dlopen("PATH_FROM_BINDGEN",GLOBAL_SYMBOLS);returnattach(lib);// all of the associated bindings from the bindgen}
Hello, it would be nice if instead of eagerly loading the binary library synchronously
deno_bindgen
would export a function called something likeload
which would be a function that doesDeno.dlopen
and attaches all of the helper functions to an object that is returned. Therefore, people could instantiate multiple instances of their library in cases where there is different state that they want instead of having to write multiple awkward dynamic imports. Also, it would help when enabling testing and benchmarking in sub libraries that use deno bindgen to not always need to wait for the synchronousDeno.dlopen
call to finish at the start of each run when it may not be needed.The text was updated successfully, but these errors were encountered: