Hypnotoad and IOLoop->remove($id) not working...

26 views
Skip to first unread message

Henry Foolman

unread,
May 18, 2017, 6:00:53 AM5/18/17
to Mojolicious
Hi list,
this is my first post and already have an Mojolicious APP running.
First i struggled with a missing IPC mech when using hypnotoad which a worked around by using a Storable HASH.
But now i'm not sure how to fix a "problem" which is frankly a design issue.
hypnotoad forks processes which they obviously don't know each other. That's clear, but how to overcome some issues regarding the fact of forked processes when they must share some data. (like EVLoops).
Problem:
I have a recurring timer which gets removed on some circumstances using IOLoop->remove($id).
I store my ids in a storable hash.
So far so good.
But, if i call my stop procedure via remove->($id) and the connection is to another process, than, of cource, the IOLoop will not be removed since it belong to another $$.
Since there's no manual which describes how to overcome the problem, do i have to use threads instead of hypnotoad ?
Perhaps there's a solution i don't know by know via initializing the recurring timer in the hypnotoad main, but then i cannot access it via a $app, or can i ?
It would be great to have an IPC example which covers all the problems caused by preforking.
Right now i will try to move my logic by creating a custom hypnotoad script but not sure if this will work out.

Any hints will be greatly appreciated.

Rgds.

Frank

Henry Foolman

unread,
May 18, 2017, 7:59:51 AM5/18/17
to Mojolicious

So i found a solution using my Storable Hash by stopping the IO Loop inside the recurring IO Loop.
Some background, i use Minion and find the static solution by specifying worker queues on the commandline not flexible enough.
So i created on-demand workers and on demand queues to seperate common jobs.
That's working now.

Rgds.
Franz
Reply all
Reply to author
Forward
0 new messages