Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement last-event-id header #113

Open
piranna opened this issue Oct 18, 2024 · 2 comments
Open

Implement last-event-id header #113

piranna opened this issue Oct 18, 2024 · 2 comments

Comments

@piranna
Copy link

piranna commented Oct 18, 2024

Id is being send, but header is being ignored. Allow to optionally handled It, just only i'm not sure if as a TimeOut to keep messages in Memory as a caché, or as an uset provided función that fully handled them.

@piranna
Copy link
Author

piranna commented Oct 18, 2024

Maybe an object with a get and a set methods could work, so internally it can be implemented whatever it fits. The most simple case could be just a dict where keys are the IDs and values are the events themselves.

@piranna
Copy link
Author

piranna commented Oct 19, 2024

Ok, I've found that it's not strictly necesary to add the support at sse-starlette, but instead it's possible to do it at the ContentStream provided as argument of EventSourceResponse constructor, by passing the header as an argument of the iterator, as storing it before yiending the data for the ServerSentEvent object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant