invokeAllClients method

Stream<TdlibInvokeResult> invokeAllClients(
  1. String method, {
  2. Map? parameters,
  3. bool isVoid = false,
  4. bool? isUseCache,
  5. Duration? durationCacheExpire,
  6. Duration? delayDuration,
  7. Duration? invokeTimeOut,
  8. String? extra,
})

invoke request all client

Implementation

Stream<TdlibInvokeResult> invokeAllClients(
  String method, {
  Map? parameters,
  bool isVoid = false,
  bool? isUseCache,
  Duration? durationCacheExpire,
  Duration? delayDuration,
  Duration? invokeTimeOut,
  String? extra,
}) async* {
  for (int clientId in getAllClientIds()) {
    try {
      Map result = await invoke(
        method,
        parameters: parameters,
        isUseCache: isUseCache,
        durationCacheExpire: durationCacheExpire,
        clientId: clientId,
        isVoid: isVoid,
        delayDuration: delayDuration,
        invokeTimeOut: invokeTimeOut,
        extra: extra,
        isInvokeThrowOnError: false,
      );

      yield TdlibInvokeResult(
        client_id: clientId,
        result: result,
      );
    } catch (e) {
      if (e is Map) {
        yield TdlibInvokeResult(
          client_id: clientId,
          result: e,
        );
      }
    }
  }
}