fetch method
Implementation
@override
Future<bool> fetch(String channel, int timestamp,
{int timeoutSeconds = 5}) async {
Completer<bool> completer = Completer();
Push push = phoenixChannel.push("fetch", {
"channel": channel,
"timestamp": timestamp,
});
push.onReply("ok", (PushResponse pushResponse) {
completer.complete(true);
});
push.onReply("error", (PushResponse pushResponse) {
completer.complete(false);
});
Future.delayed(Duration(seconds: timeoutSeconds), () {
completer.complete(false);
});
return completer.future;
}