Ask the web page to remind you of the high-quality solution!

idea
notification interface of 1.web
2. Rotation training database-here rotation training seems to be a timer, and there is also a web interface that seems to satisfy
3. Using web socket whether you set it up yourself or without a third party.
the problem now is how to implement a custom reminder style and be able to display notifications across browser tabs, that is, notifications on the A tag can also be notified when you switch to the B tab?


requirements can be further refined
similar to each upgrade prompt to load and then prompt?
or a sudden prompt during browsing (while the process is running)?
if you keep communicating at all times. For example, a war game is definitely better than socket. If the frequency is not high, long polling can be done
business requirements before deciding on this technology

you can consider using laravel to do it. There are two ways to do it. The first is to do it with the help of the pusher package, which is relatively easy, but there is a limit on the number of connections, and there will be a charge if you exceed it. The other is to use laravel's broadcast mechanism combined with redis and socket.io to achieve real-time communication as you said.
redis+socket.io tutorial

I have also implemented message push and one-to-one push according to this tutorial. The landlord can take a look at


I don't know if it is necessary to use the notification technology stack for the feature you mentioned, because I haven't used it either. But according to your comments with the first two, it's roughly a message push function.

in fact, you can refer to workerman's message push system
what you do in the background, you can use this framework to push to your specified or all clients, the custom style you mentioned. It can be processed in the background, packaged and sent to the client, and the client listens to the port through socket and displays it.


your side is divided into two questions

1
2

message push method:

:setInterval + ajax
websocket:websocket api
sse:EventSource

message display method:

model
notification api

suggestion: websocket + notification

websocket:php  Gateway
notification:

if there is no problem with message push, just talk about experience

notification is definitely the best. No matter which tab you are on, it will pop up directly, which is system-level

.

clipboard.png

clipboard.png

apihttps://segmentfault.comtitle

clipboard.png

is actually quite obvious

.

it is recommended to do both to make the experience better

Menu