Hello Peers,
I am implementing Server sent events using Node.js as a CAP Application. But there are a few things that I can't seem to figure out. Can someone please help?
1) everything in cap is in terms of Services. and services have functions and actions i.e. (Get and Post) requests respectively. So I try to have a function for my Server in a Server side event. But all functions in CAP return something. Whereas a pure vanilla nodejs application would only require listening constantly to a port and exposing the write function of the response object that we get from express. This can be seen in the below example code. So my question is that what would my server return if I have to implement it as a CAP service function?. How can I implement a Server sent event.
Code in vanila js:

2) CAP Also offers messaging using event emitters and event recievers. Do they also work on the principle of SSE? Are they the state of the art practice for message sharing between different CAP Applications?
Request clarification before answering.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.