requestAllClients method

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

invoke request all client

Implementation

Stream<TdlibInvokeResult> requestAllClients(
  String method, {
  Map? parameters,
  bool isVoid = false,
  String? extra,
  bool? isUseCache,
  Duration? durationCacheExpire,
}) async* {
  parameters ??= {};
  for (int clientId in getAllClientIds()) {
    try {
      var result = await request(
        method,
        parameters: parameters,
        clientId: clientId,
        isVoid: isVoid,
        extra: extra,
        isUseCache: isUseCache,
        durationCacheExpire: durationCacheExpire,
      );
      yield TdlibInvokeResult(
        client_id: clientId,
        result: result,
      );
    } catch (e) {
      if (e is Map) {
        yield TdlibInvokeResult(
          client_id: clientId,
          result: e,
        );
      }
    }
  }
}