-
Notifications
You must be signed in to change notification settings - Fork 16
Description
Hi, i am trying to do some action when the connection is closed (by using the EventFlux.instance.disconnect()) but the callback is never called
here is my implementation
EventFlux.instance.connect(EventFluxConnectionType.get, '${dotenv.env['MERCURE_HUB_URL']!}?topic=teams/${state.currentTeam!.uuid!}', // Called when the connection is successfully established. autoReconnect: true, reconnectConfig: ReconnectConfig( mode: ReconnectMode.linear, maxAttempts: 5, onReconnect: () {}), onSuccessCallback: (EventFluxResponse? response) { print("Co inited"); // Listen to the stream for incoming data. response?.stream?.listen((eventData) { try { // Some code here } } catch (e) { Sentry.captureException(e); } }); }, onConnectionClose: () { print("Co closed"); }, // Handle connection errors. onError: (e) { Sentry.captureException(e); // Optionally inspect error.message for more details. }, header: header);