Skip to content

Closing SSE Subscriptions #351

@riot-jayb

Description

@riot-jayb

Hello,

We recently noticed when using the event listener functionality that the RemoveEventListener() does not clean up the stream if using SSE mode.

Based on the current code, it seems that this would not be an issue if you (a) reuse the marathon client or (b) use one global SSE listener for all deploys. Unfortunately we are currently recreating marathon client on every deploy, and also trying to subscribe one listener per deploy.

While we have a few options that we control (namely moving towards a global listener or reusing our marathon client), I would think that adding support to RemoveEventListener() to close the stream would be helpful. Do you agree?

If so, I can work on a PR. From a quick pass, it seems reasonable to add an SSE stream close channel to the marathon client struct and send a message down that channel to the stream listening goroutine when RemoveEventListener() is called in SSE mode.

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