push method

  1. @override
Future<PushResult> push(
  1. String topic,
  2. String event,
  3. Map<String, dynamic> payload
)
override

Pushes event with payload to topic. Returns a PushResult reflecting the server's reply (or a timeout/disconnect marker).

Implementation

@override
Future<PushResult> push(
  String topic,
  String event,
  Map<String, dynamic> payload,
) async {
  recorded.pushes.add(
    RecordedPush(topic: topic, event: event, payload: payload),
  );
  final queue = _replyQueue['$topic::$event'];
  if (queue == null || queue.isEmpty) {
    return const PushTimeout();
  }
  return queue.removeAt(0);
}