libsql-client-ts icon indicating copy to clipboard operation
libsql-client-ts copied to clipboard

`createClient` using embedded replica blocks on I/O

Open CodingDoug opened this issue 2 years ago • 0 comments

createClient should not block the caller at all, nor throw errors unrelated to the validity of the parameters it receives. An example of a thrown error can be seen in #98.

Seems related to https://github.com/libsql/libsql-js/issues/22

Instead, the SDK should try to connect asynchronously after client creation, and defer any errors to first async method call on the client. Either that, or there should be a new client factory function that returns a promise instead of a client object and operates entirely async.

CodingDoug avatar Sep 21 '23 21:09 CodingDoug