Skip to content

onConnectionClose not called #40

@adam-nlem

Description

@adam-nlem

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions