Guest worker 'watch' example?

29 views
Skip to first unread message

Pedro Henrique Peixoto

unread,
Aug 7, 2015, 10:44:05 AM8/7/15
to Crossbar
Do you guys have any example about using Guest worker 'watch' option?

I'd like to monitor some PHP guest workers and there is almost no documentation about how to do that.
I manage to get DirWatcher working (had to install some python package), but i don't really know how to use it.

Thankful,

Pedro Peixoto.

Johnny W. Santos

unread,
Aug 7, 2015, 11:14:05 AM8/7/15
to cross...@googlegroups.com
I think the intent of watch is to work as a trigger to a hot-reload every time something change on your guest code. What kinds of events you want to monitor?


--
You received this message because you are subscribed to the Google Groups "Crossbar" group.
To unsubscribe from this group and stop receiving emails from it, send an email to crossbario+...@googlegroups.com.
To post to this group, send email to cross...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/crossbario/0a607c97-a599-4100-a51a-f8f6eab099c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Johnny W. dos Santos

Johnny W. Santos

unread,
Aug 7, 2015, 11:26:33 AM8/7/15
to Crossbar
Here is the code called when watch catch a file system event

https://github.com/crossbario/crossbar/search?p=2&q=action&utf8=%E2%9C%93

There is nothing but restarting implemented in the handler.

Pedro Henrique Peixoto

unread,
Aug 7, 2015, 12:10:52 PM8/7/15
to Crossbar
Hi,

Thank you for replying.

I'd like to monitor my running guest, and if it cashes, i'd like it to be restarted. Now that you mentioned it, restarting the guest based on source-code changes would be great too.

Johnny W. Santos

unread,
Aug 7, 2015, 1:25:11 PM8/7/15
to cross...@googlegroups.com
I would suggest you something like supervisord to handle those things, but if you just want something simpler during development for example, you could watch a log directory and your worker could write there when a crash occur, then crossbar would restart this guest worker.


For more options, visit https://groups.google.com/d/optout.

Pedro Henrique Peixoto

unread,
Aug 7, 2015, 8:27:21 PM8/7/15
to Crossbar
Sounds like it could work. Maybe a watch for a PID file? I'll have a try on this and post back the results.
Reply all
Reply to author
Forward
0 new messages