Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: RPC via mysql when running under websocketd?

by Anonymous Monk
on Sep 08, 2015 at 03:30 UTC ( #1141302=note: print w/replies, xml ) Need Help??


in reply to RPC via mysql when running under websocketd?

Is there a way to have one process write something to the database, and that the other process immediately detects this (maybe some kind of trigger?) so that the 2nd process may process this new data, and send data to the browser which is connected to it via the websocket?

Why not polling?

  • Comment on Re: RPC via mysql when running under websocketd?

Replies are listed 'Best First'.
Re^2: RPC via mysql when running under websocketd?
by schweini (Friar) on Sep 08, 2015 at 04:02 UTC
    Because the whole point of using websockets for me is to reduce latency.
    And I am guessing that polling the database all the time is computationally expensive.

      Because the whole point of using websockets for me is to reduce latency. And I am guessing that polling the database all the time is computationally expensive.

      What kind of latency are you looking for?

      I doubt its expensive to query the database for messages since X ... once or three times a second ... "realtime" for humans :)

      In truth, all "events" are actually just variations of polling with different softwares doing the polling (OS...)

      See also Mojolicious: Websocket example under hypnotoad for similar discussion

        So in that thread it used to be So there is the context, use Mojo::Redis - Asynchronous Redis client for Mojolicious. but its now deprecated with link to Mojo::Redis2 - Pure-Perl non-blocking I/O Redis driver ... redis ... The Publish/Subscribe feature is fully implemented, so a client of a slave may SUBSCRIBE to a channel and receive a full feed of messages PUBLISHed to the master, anywhere up the replication tree.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1141302]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2020-06-02 06:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (13 votes). Check out past polls.

    Notices?