-
-
Notifications
You must be signed in to change notification settings - Fork 284
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
feat(sse): add @tsed/sse package #2763
Conversation
5f960a9
to
b2da9e3
Compare
Benchmarks
ExplanationThe benchmark shows a performance difference between the frameworks. We note that Ts.ED is often last. In fact, Ts.ED uses features useful to a production application which reduce its performance. For example, Ts.ED initializes a sandbox (async_hook) for each request in order to work in an isolated context if necessary. All this at a necessary cost that reflects the reality of a production application ;) |
b2da9e3
to
49f1fdb
Compare
Benchmarks
ExplanationThe benchmark shows a performance difference between the frameworks. We note that Ts.ED is often last. In fact, Ts.ED uses features useful to a production application which reduce its performance. For example, Ts.ED initializes a sandbox (async_hook) for each request in order to work in an isolated context if necessary. All this at a necessary cost that reflects the reality of a production application ;) |
49f1fdb
to
3a2a1ad
Compare
Benchmarks
ExplanationThe benchmark shows a performance difference between the frameworks. We note that Ts.ED is often last. In fact, Ts.ED uses features useful to a production application which reduce its performance. For example, Ts.ED initializes a sandbox (async_hook) for each request in order to work in an isolated context if necessary. All this at a necessary cost that reflects the reality of a production application ;) |
3a2a1ad
to
67aaf6a
Compare
Benchmarks
ExplanationThe benchmark shows a performance difference between the frameworks. We note that Ts.ED is often last. In fact, Ts.ED uses features useful to a production application which reduce its performance. For example, Ts.ED initializes a sandbox (async_hook) for each request in order to work in an isolated context if necessary. All this at a necessary cost that reflects the reality of a production application ;) |
@IvaDey This PR can be review and add officially the sse support to Ts.ED ;) |
🎉 This PR is included in version 7.79.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Information
Server-send event let you push data to the client. It's a simple way to send data from the server to the client. The data is sent as a stream of messages, with an optional event name and id. It's a simple way to send data from the server to the client.
Installation
Before using the Socket.io, we need to install the Socket.io module.
Then add the following configuration in your Server:
::: warning
compression
middleware should be disabled for correct SSE work:::
Enable event-stream
To enable the event-stream, you need to use the
@EventStream
decorator on a method of a controller.Stream events
You can use Node.js stream like
EventEmmiter
to emit events from your controller to your consumer:Observable
You can also use
Observable
fromrxjs
to emit events from your controller to your consumer:Todos