call method
Future<RealtimeResult>
call(
- String op, {
- Map<
String, String> params = const {}, - Object? body,
- String? ifMatch,
- String? id,
- Duration? timeout,
override
Calls REST operation op over the socket (envelope id = idempotency key id).
Implementation
@override
Future<RealtimeResult> call(
String op, {
Map<String, String> params = const {},
Object? body,
String? ifMatch,
String? id,
Duration? timeout,
}) async {
final r = await _emit('call', {
'op': op,
if (params.isNotEmpty) 'params': params,
'body': ?body,
'ifMatch': ?ifMatch,
'id': ?id,
}, timeout);
final m = r is Map ? r.cast<String, Object?>() : const <String, Object?>{};
return RealtimeResult(
(m['status'] as int?) ?? 200,
m['body'],
etag: m['etag'] as String?,
);
}