Guest worker 'watch' example?

#1

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.

0 Likes

#2

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?

···

On Fri, Aug 7, 2015 at 11:44 AM, Pedro Henrique Peixoto phrfp...@gmail.com wrote:

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.

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

0 Likes

#3

Here is the code called when watch catch a file system event

https://github.com/crossbario/crossbar/search?p=2&q=action&utf8=✓

There is nothing but restarting implemented in the handler.

···

On Friday, August 7, 2015 at 11:44:05 AM UTC-3, Pedro Henrique Peixoto wrote:

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.

0 Likes

#4

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.

···

Em sexta-feira, 7 de agosto de 2015 12:14:05 UTC-3, Johnny W. Santos escreveu:

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?

On Fri, Aug 7, 2015 at 11:44 AM, Pedro Henrique Peixoto phrf...@gmail.com wrote:

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.

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 cros...@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

0 Likes

#5

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.

···

On Fri, Aug 7, 2015 at 1:10 PM, Pedro Henrique Peixoto phrfp...@gmail.com wrote:

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.

Em sexta-feira, 7 de agosto de 2015 12:14:05 UTC-3, Johnny W. Santos escreveu:

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?

On Fri, Aug 7, 2015 at 11:44 AM, Pedro Henrique Peixoto phrf...@gmail.com wrote:

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.

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 crossba...@googlegroups.com.

To post to this group, send email to cros...@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

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/7370696a-bfaf-44a0-a8f0-a19125923647%40googlegroups.com.

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

Johnny W. dos Santos

0 Likes

#6

Sounds like it could work. Maybe a watch for a PID file? I’ll have a try on this and post back the results.

···

Em sexta-feira, 7 de agosto de 2015 14:25:11 UTC-3, Johnny W. Santos escreveu:

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.

On Fri, Aug 7, 2015 at 1:10 PM, Pedro Henrique Peixoto phrf...@gmail.com wrote:

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.

Em sexta-feira, 7 de agosto de 2015 12:14:05 UTC-3, Johnny W. Santos escreveu:

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?

On Fri, Aug 7, 2015 at 11:44 AM, Pedro Henrique Peixoto phrf...@gmail.com wrote:

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.

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 cros...@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

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 cros...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/crossbario/7370696a-bfaf-44a0-a8f0-a19125923647%40googlegroups.com.

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


Johnny W. dos Santos

0 Likes