Re: [Mojolicious] What about an after_server_start hook?

2018-11-23 Thread Stefan Adams
"During startup your application is preloaded in the manager process, which
does not run an event loop"

So it looks like what I was hoping for is not possible.  :(

On Fri, Nov 23, 2018 at 8:13 PM Stefan Adams  wrote:

> Ah, shoot.  That kicks off for every worker process.  Any way to do
> something where it runs just in the manager process?
>
> On Fri, Nov 23, 2018 at 8:10 PM Stefan Adams  wrote:
>
>> Ah!  How cool!  Thank you for that!  That's gives me better context now
>> for understanding the purpose and value of next_tick.  :)
>>
>> On Fri, Nov 23, 2018 at 8:04 PM Dan Book  wrote:
>>
>>> You can set up code to be run whenever the ioloop is started, which
>>> happens in each worker process when it starts in a prefork server, by
>>> adding a next_tick callback as indicated here:
>>> https://metacpan.org/pod/Mojolicious::Guides::Cookbook#Pre-forking
>>>
>>> -Dan
>>>
>>> On Fri, Nov 23, 2018 at 6:24 PM Stefan Adams  wrote:
>>>
 Sometimes it would be nice to have an event / hook for after the server
 has started.  Specifically, I'd want to kick off an automated process with
 Mojo::IOLoop->timer|recurring but only after the web server has started.

 Is this possible?  And if not, is it a Pull Request that would be
 considered?

 --
 You received this message because you are subscribed to the Google
 Groups "Mojolicious" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to mojolicious+unsubscr...@googlegroups.com.
 To post to this group, send email to mojolicious@googlegroups.com.
 Visit this group at https://groups.google.com/group/mojolicious.
 For more options, visit https://groups.google.com/d/optout.

>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Mojolicious" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to mojolicious+unsubscr...@googlegroups.com.
>>> To post to this group, send email to mojolicious@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/mojolicious.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


Re: [Mojolicious] What about an after_server_start hook?

2018-11-23 Thread Stefan Adams
Ah, shoot.  That kicks off for every worker process.  Any way to do
something where it runs just in the manager process?

On Fri, Nov 23, 2018 at 8:10 PM Stefan Adams  wrote:

> Ah!  How cool!  Thank you for that!  That's gives me better context now
> for understanding the purpose and value of next_tick.  :)
>
> On Fri, Nov 23, 2018 at 8:04 PM Dan Book  wrote:
>
>> You can set up code to be run whenever the ioloop is started, which
>> happens in each worker process when it starts in a prefork server, by
>> adding a next_tick callback as indicated here:
>> https://metacpan.org/pod/Mojolicious::Guides::Cookbook#Pre-forking
>>
>> -Dan
>>
>> On Fri, Nov 23, 2018 at 6:24 PM Stefan Adams  wrote:
>>
>>> Sometimes it would be nice to have an event / hook for after the server
>>> has started.  Specifically, I'd want to kick off an automated process with
>>> Mojo::IOLoop->timer|recurring but only after the web server has started.
>>>
>>> Is this possible?  And if not, is it a Pull Request that would be
>>> considered?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Mojolicious" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to mojolicious+unsubscr...@googlegroups.com.
>>> To post to this group, send email to mojolicious@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/mojolicious.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Mojolicious" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to mojolicious+unsubscr...@googlegroups.com.
>> To post to this group, send email to mojolicious@googlegroups.com.
>> Visit this group at https://groups.google.com/group/mojolicious.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


Re: [Mojolicious] What about an after_server_start hook?

2018-11-23 Thread Stefan Adams
Ah!  How cool!  Thank you for that!  That's gives me better context now for
understanding the purpose and value of next_tick.  :)

On Fri, Nov 23, 2018 at 8:04 PM Dan Book  wrote:

> You can set up code to be run whenever the ioloop is started, which
> happens in each worker process when it starts in a prefork server, by
> adding a next_tick callback as indicated here:
> https://metacpan.org/pod/Mojolicious::Guides::Cookbook#Pre-forking
>
> -Dan
>
> On Fri, Nov 23, 2018 at 6:24 PM Stefan Adams  wrote:
>
>> Sometimes it would be nice to have an event / hook for after the server
>> has started.  Specifically, I'd want to kick off an automated process with
>> Mojo::IOLoop->timer|recurring but only after the web server has started.
>>
>> Is this possible?  And if not, is it a Pull Request that would be
>> considered?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Mojolicious" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to mojolicious+unsubscr...@googlegroups.com.
>> To post to this group, send email to mojolicious@googlegroups.com.
>> Visit this group at https://groups.google.com/group/mojolicious.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mojolicious+unsubscr...@googlegroups.com.
> To post to this group, send email to mojolicious@googlegroups.com.
> Visit this group at https://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


Re: [Mojolicious] What about an after_server_start hook?

2018-11-23 Thread Dan Book
You can set up code to be run whenever the ioloop is started, which happens
in each worker process when it starts in a prefork server, by adding a
next_tick callback as indicated here:
https://metacpan.org/pod/Mojolicious::Guides::Cookbook#Pre-forking

-Dan

On Fri, Nov 23, 2018 at 6:24 PM Stefan Adams  wrote:

> Sometimes it would be nice to have an event / hook for after the server
> has started.  Specifically, I'd want to kick off an automated process with
> Mojo::IOLoop->timer|recurring but only after the web server has started.
>
> Is this possible?  And if not, is it a Pull Request that would be
> considered?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mojolicious+unsubscr...@googlegroups.com.
> To post to this group, send email to mojolicious@googlegroups.com.
> Visit this group at https://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


[Mojolicious] What about an after_server_start hook?

2018-11-23 Thread Stefan Adams
Sometimes it would be nice to have an event / hook for after the server has
started.  Specifically, I'd want to kick off an automated process with
Mojo::IOLoop->timer|recurring but only after the web server has started.

Is this possible?  And if not, is it a Pull Request that would be
considered?

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.