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

fix(llc): watch support for queryCalls method #722

Merged
merged 2 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion docusaurus/docs/Flutter/03-core-concepts/06-querying-calls.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,13 @@ final result = await video.queryCalls(
);
```

The `queryCalls` function can take multiple sort parameters, which can be combined with filtering to give you powerful control over the data in your application.
The `queryCalls` function can take multiple sort parameters, which can be combined with filtering to give you powerful control over the data in your application.

### Watching calls
If you specify `watch` parameter as `true`, the SDK will create a subscription to the call data on the server and you'll be able to receive updates in real-time.

The server will send updates to the client when the call data changes (for example, members are updated, a call session has started, etc...). This is useful for showing a live preview of who is in the call or building a call dashboard.

You can listen to call events via the `StreamVideo.instance.events` stream.

Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ abstract class CoordinatorClient {
String? prev,
List<open.SortParam> sorts = const [],
int? limit,
bool? watch,
});

Future<Result<None>> blockUser({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,7 @@ class CoordinatorClientOpenApi extends CoordinatorClient {
String? prev,
List<open.SortParam> sorts = const [],
int? limit,
bool? watch,
}) async {
try {
final connectionResult = await _waitUntilConnected();
Expand All @@ -889,6 +890,7 @@ class CoordinatorClientOpenApi extends CoordinatorClient {
prev: prev,
sort: sorts,
limit: limit,
watch: watch,
),
);
if (result == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ class CoordinatorClientRetry extends CoordinatorClient {
String? prev,
List<open.SortParam> sorts = const [],
int? limit,
bool? watch,
}) {
return _retryManager.execute(
() => _delegate.queryCalls(
Expand All @@ -342,6 +343,7 @@ class CoordinatorClientRetry extends CoordinatorClient {
prev: prev,
sorts: sorts,
limit: limit,
watch: watch,
),
(error, nextAttemptDelay) async {
_logRetry('queryCalls', error, nextAttemptDelay);
Expand Down
2 changes: 2 additions & 0 deletions packages/stream_video/lib/src/stream_video.dart
Original file line number Diff line number Diff line change
Expand Up @@ -527,13 +527,15 @@ class StreamVideo extends Disposable {
String? prev,
int? limit,
List<open.SortParam>? sorts,
bool? watch,
}) {
return _client.queryCalls(
filterConditions: filterConditions,
next: next,
limit: limit,
prev: prev,
sorts: sorts ?? [],
watch: watch,
);
}

Expand Down
Loading