So I'm playing around with websockets, using websocketd.
I have two users connected, and each websocketd-spawend process has an open DBI connection, but they don't really know anything about each other, apart from the fact that there is a row in a table where both session ids are stored.
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?
I guess the normal way would be to do this via signals and other IPC mechanisms, but if at all possible, i'd like to minimize complexity.
EDIT: i guess the sane way to go is to use SysV shared memory via one of the many available modules. But I can't find any way of monitoring shared memory in a way that if process #1 modifies it, that process #2 somehow gets notified (be it via a signal, or something like Tie::Watch
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.