call method

Future<bool> call(
  1. dynamic callbackKey,
  2. T1 param
)

Invokes the appropriate callback.

  • callbackKey Specify which callback to invoke.
  • param Specify a parameter to pass to the callback.

Returns true if the callback was found and invoked, otherwise false.

Implementation

Future<bool> call(dynamic callbackKey, T1 param) async {
  return this._queue.add(() async {
    final callback = this._callbacks[callbackKey];
    await callback?.call(callbackKey, param);
    return callback != null;
  });
}