Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 add Open live query event #45

Merged
merged 1 commit into from
Nov 30, 2023
Merged

Conversation

Odonno
Copy link
Contributor

@Odonno Odonno commented Nov 12, 2023

  • Add Open event to detect when started to listen to Live Query
  • Change tests and fixes ObserveQuery/ObserveTable, using a cold Observable

@simon-curtis
Copy link
Contributor

Could this be extended to use System.Threading.Channels.ChannelReader<T>?

It might allow for flexibility in consumption and better handling of back pressure

@Odonno
Copy link
Contributor Author

Odonno commented Nov 17, 2023

Could this be extended to use System.Threading.Channels.ChannelReader<T>?

It might allow for flexibility in consumption and better handling of back pressure

Hi Simon.

I don't fully understand. What part of the code are you talking about?

Live Query are already using unbounded Channel<T>, using both a ChannelWriter<T> and ChannelReader<T> underneath. See the class here: https://github.com/surrealdb/surrealdb.net/blob/main/SurrealDb.Net/Internals/Models/LiveQuery/SurrealDbLiveQueryChannel.cs

@simon-curtis
Copy link
Contributor

Could this be extended to use System.Threading.Channels.ChannelReader<T>?
It might allow for flexibility in consumption and better handling of back pressure

Hi Simon.

I don't fully understand. What part of the code are you talking about?

Live Query are already using unbounded Channel<T>, using both a ChannelWriter<T> and ChannelReader<T> underneath. See the class here: https://github.com/surrealdb/surrealdb.net/blob/main/SurrealDb.Net/Internals/Models/LiveQuery/SurrealDbLiveQueryChannel.cs

Ahh, apologies. I was on my phone and didn't see that you already had a wrapper for it.

@Odonno Odonno force-pushed the fix/live-query-open branch 2 times, most recently from e3ef72c to caef639 Compare November 23, 2023 11:28
@codecov-commenter
Copy link

Codecov Report

Attention: 22 lines in your changes are missing coverage. Please review.

Comparison is base (4fd0474) 70.27% compared to head (1ff28a0) 70.26%.

Files Patch % Lines
...b.Reactive/Extensions/SurrealDbClientExtensions.cs 71.42% 20 Missing ⚠️
...rrealDb.Net/Models/LiveQuery/SurrealDbLiveQuery.cs 33.33% 0 Missing and 2 partials ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #45      +/-   ##
==========================================
- Coverage   70.27%   70.26%   -0.01%     
==========================================
  Files         108      109       +1     
  Lines        3566     3575       +9     
  Branches      358      361       +3     
==========================================
+ Hits         2506     2512       +6     
- Misses        882      884       +2     
- Partials      178      179       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kearfy kearfy merged commit 9dc5bdc into surrealdb:main Nov 30, 2023
1 of 2 checks passed
@Odonno Odonno deleted the fix/live-query-open branch November 30, 2023 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants