-
-
Notifications
You must be signed in to change notification settings - Fork 67
feat: use single isolate for functions and postgrest #169
Conversation
Don't we want the user to be able to provide their own isolate instance? Additionally, I think we should call |
@Vinzent03 Hmm, still trying to figure out why test started failing massively once I added About making it possible to pass custom isolate, would there be any use case where one might want to pass in their custom isolate? I'm a fan of keeping the public API simple, so maybe we can wait until someone requests the feature. |
When reverting d804f05 all tests pass for me locally. The The use case for keeping the same isolate would be server side for me. Because of the current api you have to construct a new supabase-dart instance every time you want to act as a different user. Being able to keep the same isolate for these short living instances could improve performance. |
@Vinzent03 Yeah, I have misread something, and it seems like calling
Ah, I always forget server side Dart 😂 Yup, sounds good. Let's add an option to pass in an isolate to Supabase client! |
* add initialize back in * run tests against all pr * add a small delay after each test case * add option to receive isolate when creating client * add a longer delay between tests * remove unnecessary delay * set web socket channel version
Leaving a note here: Using web_socket_channel v2.3.0 causes the tests to fail like this. Fixing the version of web_socket_channel to v2.2.0 solves the issue for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm overall
Co-authored-by: Bruno D'Luka <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What kind of change does this PR introduce?
Instantiates a single instance of
YAJsonIsolate
and reuses it for Postgrest and functions-dart.