Skip to content

Issues regarding to SSE events #336

@iandyh

Description

@iandyh

There are some issues with SSE events that I like to discuss because I don't know how it can be moved on.

  1. Currently go-marathon is using https://github.com/donovanhide/eventsource as underlying client. However, the client itself has some issues. For example, Check if a stream is closed just before writing to the stream channels donovanhide/eventsource#33. It seems like it might take some time to get it fixed. Rewriting the client will require some changes to go-marathon as well. This will bring to the second topic

  2. When go-marathon is disconnected from the server, it should immediately return to the application side and let the application side refresh the states in Marathon. Simply retrying, which is the current strategy, will result the application missing the events and eventually out-sync with states in Marathon. In an extreme case, due to network issue, the application can be disconnected from Marathon for long time and when retry finally succeeds, the local state is already largely behind.
    So the client also needs to expose an errors channel to the application side.

  3. Another issue is potentially, the order of the events received in each listener can be different from the events received from Marathon. I mentioned the issued in this closed pr: expose orignal events queue to applications #270 But at the time, I did not spend too much time on it because our app does not require the order to be correct but it's no longer the case.

But before fix issue 3 I really wish issue 1 and 2 can be solved because currently I am using a non-elegant fix in my private fork. What are your guys' opinions on the issues?

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