Re: [Mojolicious] IOLoop Connections
The list of events are right there in the documentation: https://metacpan.org/pod/Mojo::IOLoop::Server#EVENTS On Wednesday, July 13, 2016 at 2:11:44 AM UTC+2, Brian Shaw wrote: > > Thanks. That worked well. Do you know if there is a complete list of > events? > > Brian > > > On Sunday, July 10, 2016 at 5:46:06 PM UTC-4, Alex Alex wrote: >> >> You could use Mojo::IOLoop::Server; accept event. >> https://metacpan.org/pod/Mojo::IOLoop::Server >> >> >> >> Is there a way to tell when a client has completed the initial >> connection to the server, as opposed to any other time in the life of the >> connection? >> With HTTP(S) you just sit and wait until the client says something like >> "GET /". >> I'm trying to write a mail server and the SMTP protocol specifies that >> the server, not the client, starts the conversation once the client >> connects. >> If there is some way outside of IOLoop to do this, I'm okay with >> changing directions. >> Thanks for any suggestions or code snippets. >> >> Brian >> -- >> 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...@googlegroups.com. >> To post to this group, send email to mojol...@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] Re: How to find out the name of a placeholder the route is using
Why not just hard-code %url_params? Often it will be a lot more obvious to see what you're actually passing on. $url_params{foo} = $db_row->{whatever}; I used to think making everything very dynamic was a good idea. I don't anymore. There's a bunch of cases where being specific can make the code easier to read and less exposed to bugs. On Friday, July 22, 2016 at 3:12:52 AM UTC+2, Randall Sindlinger wrote: > > Hi, > > I'd like to take a given named route, and ask what the placeholders are > that it expects. > > I'm trying to do a relatively simple call of > $c->url_for( $route_name, \%url_params ); > > However, the keys for %url_params are coming out of database tables, and > I've run into a case where the logic is breaking down when I create the > key. (it's trying to append '_identifier' to the column name when it > shouldn't). > > I'd like to be able to check if the key name that is created matches the > placeholder name used by the route before calling out to url_for. > > It looks like if I do > $foo=$c->app->routes->find($route_name) > that then I can see the placeholder underneath > $foo->pattern->tree > > But I feel like I'm diving too deep into it. Is there a better way? > > Thanks in advance for any thoughts, > -Randall > -- 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] Re: Deployment: launch hypnotoad on boot
I just use cron for starting on boot: $ crontab -l @reboot /path/to/myserver.sh 1>>/path/to/log/file.log 2>>/path/to/log/file.log The reason why I have a shell script first is to set up %ENV and friends. If you don't need that, then you can just point directly to the application. I also sometimes add a hack to the shell script to see if a given database is started if the application require that to start up. So... this is a rather hackish solution for the complicated, but (for me) a very simple solution for the simple cases. I would say using upstart. initv or systemd is a lot cleaner though, but it *might* require more work. On Friday, July 22, 2016 at 12:44:57 PM UTC+2, Gabor Szabo wrote: > > Hi, > > I am trying to deploy a Mojolicious-based application on an Ubuntu server. > When I launch the application with hypnotoad everything is fine, but I > wonder what is the recommended way to make the Hypnotoad server launch when > I reboot the Linux box? > > I looked at > http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#DEPLOYMENT but > could not find this information. > > regards >Gabor > -- 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.