How to capture EventSource messages while process is running? |
Well, after I was ashamed with my quick and unprofessional response into this thread I could not get asleep without putting my hands on this.
Few interesting learnings, probably would be useful for someone:
Client (trivial wrapping omitted): Code: <button onclick="sse()">Start SSE</button> And method in CI Controller that is called from above via named route for simplicity: PHP Code: <?php namespace App\Controllers; This works like a charm in Safari, Chrome and Firefox (all desktops). No need for websockets. Useful articles I found on this topic:
Probably, CI4.x could include some out of the box support for streaming, what do you think? |
Messages In This Thread |
How to capture EventSource messages while process is running? - by SmokeyCharizard - 02-26-2020, 06:52 PM
RE: How to capture EventSource messages while process is running? - by zahhar - 02-27-2020, 01:19 AM
RE: How to capture EventSource messages while process is running? - by dave friend - 02-27-2020, 08:36 AM
RE: How to capture EventSource messages while process is running? - by zahhar - 02-27-2020, 09:53 AM
RE: How to capture EventSource messages while process is running? - by SmokeyCharizard - 02-27-2020, 12:55 PM
RE: How to capture EventSource messages while process is running? - by zahhar - 02-27-2020, 03:37 PM
RE: How to capture EventSource messages while process is running? - by SmokeyCharizard - 02-27-2020, 04:17 PM
|