waitForNews method

Future<NewsEntry> waitForNews(
  1. String key,
  2. int? timeout
)

Fetch the NewsEntry or use its event_id to wait for it to come down the wire

Implementation

Future<NewsEntry> waitForNews(
  String key,
  int? timeout,
) {
  final tmp1 = key;
  final tmp5 = timeout;
  var tmp0 = 0;
  var tmp2 = 0;
  var tmp3 = 0;
  var tmp4 = 0;
  var tmp6 = 0;
  var tmp8 = 0;
  tmp0 = _box.borrow();
  final tmp1_0 = utf8.encode(tmp1);
  tmp3 = tmp1_0.length;

  final ffi.Pointer<ffi.Uint8> tmp2_0 = _api.__allocate(tmp3 * 1, 1);
  final Uint8List tmp2_1 = tmp2_0.asTypedList(tmp3);
  tmp2_1.setAll(0, tmp1_0);
  tmp2 = tmp2_0.address;
  tmp4 = tmp3;
  if (tmp5 == null) {
    tmp6 = 0;
  } else {
    tmp6 = 1;
    final tmp7 = tmp5;
    tmp8 = tmp7;
  }
  final tmp9 = _api._clientWaitForNews(
    tmp0,
    tmp2,
    tmp3,
    tmp4,
    tmp6,
    tmp8,
  );
  final tmp11 = tmp9;
  final ffi.Pointer<ffi.Void> tmp11_0 = ffi.Pointer.fromAddress(tmp11);
  final tmp11_1 = _Box(_api, tmp11_0, "__Client_wait_for_news_future_drop");
  tmp11_1._finalizer = _api._registerFinalizer(tmp11_1);
  final tmp10 = _nativeFuture(tmp11_1, _api.__clientWaitForNewsFuturePoll);
  return tmp10;
}