tdJsonClientReceive function

TdObject? tdJsonClientReceive(
  1. int clientId, [
  2. double timeout = 8
])

Events from the incoming updates and request responses from the TDLib client by clientId identifier. Must be call once per client. Receives incoming updates and request responses from the TDLib client by clientId identifier and timeout. May be called from any thread, but shouldn't be called simultaneously from two different threads.

Implementation

// static Stream<TdObject?> clientEvents(int clientId) {
//   return _eventChannel
//       .receiveBroadcastStream(clientId)
//       .map((event) => convertToObject(event));
// }

/// Receives incoming updates and request responses from the TDLib client by [clientId] identifier and [timeout].
/// May be called from any thread, but shouldn't be called simultaneously from two different threads.
TdObject? tdJsonClientReceive(int clientId, [double timeout = 8]) {
  final res = TdPlugin.instance.tdJsonClientReceive(clientId, timeout);
  return convertToObject(res);
}