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

NodeJS + Express #13

Open
neddyKG opened this issue Nov 12, 2023 · 2 comments
Open

NodeJS + Express #13

neddyKG opened this issue Nov 12, 2023 · 2 comments
Assignees

Comments

@neddyKG
Copy link

neddyKG commented Nov 12, 2023

Thank you so much for the work on this! It's an awesome contribution. On running the Color example in an endpoint I get status of "COMPLETED", when the output didn't finish streaming yet.

Screenshot 2023-11-12 at 10 06 59
@neddyKG
Copy link
Author

neddyKG commented Nov 12, 2023

My bad, I just saw that for multiple entities the status is "COMPLETED", there wouldn't be any way to identify that the stream finished in that case, right?

@st3w4r st3w4r self-assigned this Dec 2, 2023
@st3w4r
Copy link
Owner

st3w4r commented Jan 13, 2024

Thank you for your question regarding the COMPLETED status. To clarify, this status is assigned to an entity once it has received all the fields that constitute it. This indicates the completion of one entity reception.

As for determining the completion of the entire stream, the stream is explicitly closed when there are no more data to be sent. This closure acts as a signal that the stream has completed.

For a practical example, you can refer to how this is implemented in the colors application. In the specified section of the code, you'll see that when there's no more data to consume, the stream is considered complete. And, specific logic can be executed. In this particular case, the application sends a final Server-Sent Event (SSE) message to indicate the end of the stream and ensures that the client side is properly informed when the stream has finished, allowing to close the event stream on the client.

I hope this helps in the difference between COMPLETED status and the stream ending. If you have any further questions or if you want to share your use case, feel free to ask!

I hope this explanation clarifies the difference between the COMPLETED status and the ending of the stream. If you have more questions, or if you'd like to discuss your specific use case, please feel free.

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

2 participants