The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2015-10-09

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 jontaylor joined #mojo
00:03 ajr_ joined #mojo
00:14 preaction TIL: Test::Mojo in websocket mode has state, and I shouldn't set the tx attribute to switch between multiple websockets connected to the same app...
00:24 preaction solved with: https://github.com/preaction/Mercury/commit/381c93d943c13d4131b00aaf2d4a48a00dbe365e
00:29 sri everything is stateful in Test::Mojo
00:29 sri literally
00:31 preaction yeah, no, i have _no_ idea why i thought that would work. it felt dirty doing it, but it seemed to work, and then i ran with it, and then i had a bunch of code to undo ;)
00:32 sri hmm, i say "literally" a lot
00:32 preaction been watching Parks and Recreation? ;)
00:32 sri literally!
00:33 preaction https://www.youtube.com/watch?v=_Xjka07o1-0
00:33 Grinnz is that sam from the west wing?
00:33 Grinnz it is!
00:34 aborazmeh joined #mojo
00:40 panshin joined #mojo
00:51 jberger preaction: those tests look fun
00:51 preaction now that i'm doing them right, they're a lot better, but yeah... testing the absence of a message... i haven't found a nice way of that yet
00:52 Grinnz there is no spoon
00:53 jberger Send a second message later on the same channel
00:53 jberger Once you get that one, you know the first isn't coming
00:59 preaction yeah, i could send enough unique messages so that everyone got one, and ensure the recipients got the message i expected them to get. trouble there is, especially in the push/pull test, i'm testing for edge cases in my "next round-robin recipient" logic, which involves adding/removing recipients before everyone's got a message
01:00 jberger Eeeep, yeah that's tough
01:01 jberger Maybe a secondary hook which is a poison pill
01:01 jberger I don't know if that makes sense
01:02 jberger But the loop is still running, so messages are moving
01:02 jberger Attach a listener which dies if it gets a certain message
01:03 preaction yeah, that's what i did with the stranger. and in theory that's what i'm doing with pushpull, i just am always keeping track of all messages that arrive on all sockets
01:04 preaction mainly so i didn't have to keep adding/dropping listeners. though that might make more sense to a reader if i did...
01:05 preaction "peers 0, 2, 3 must not receive messages, so install a listener for the duration of this scope". the only danger'd be in if the scope was left too early for cleanup, but at that point you've got a failing test anyway
01:10 sri heh, looks like there's already competing psgi ports for perl6
01:11 sri i guess this means someone could theoretically now do a real benchmark comparison between perl5 and perl6 http://blog.64p.org/entry/2015/10/08/104052
01:11 sri HTTP::Server::Tiny vs Starlet
01:12 sri the port seems rather uninspired, but should be good for comparisons
01:13 Zoffix This talk about async, concurrent, parrallel stuff in P6 kinda just blew my mind: https://youtu.be/JpqnNCx7wVY
01:15 Zoffix sri, I want Mojo::DOM in Perl 6 :)
01:15 sri i want time
01:15 * Grinnz wants candy
01:15 pink_mist Zoffix: http://irclog.perlgeek.de/mojo/2015-10-07#i_11334428 heh
01:16 pink_mist Zoffix: that's sri talking about the possibility of porting to p6 :P
01:16 dave I want The Right Thing(tm)
01:16 preaction I want it, I want it, I want it, I want it, but I can't have it
01:16 Zoffix I feel like a kid in a candy shop with P6 ATM. I think that's what I always lacked in P5: everything's been done.
01:16 sri just need to find a company that lets me hack on perl6 stuff for a year ;p
01:17 Zoffix sri, have you tried going the ribasushi way? :) https://www.tilt.com/tilts/year-of-ribasushi-help-him-focus-on-cpan-for-2016
01:17 sri obviously not ;p
01:17 * jberger wants a pony
01:17 Zoffix He got $10 outta me... Just sayin' :P
01:19 sri i hope he succeeds
01:19 sri it's a shame getting paid for open source is so hard
01:19 Zoffix yeah
01:25 jberger $10 is a nice token of support, but it's not what he needs
01:25 jberger To make that goal he needs big companies
01:26 jberger Those same companies that make zillions on his unbelievable efforts on their behalf
01:26 Zoffix True. But when I donated a couple of days ago his total was $6G. Now it's almost $20G
01:27 jberger Just try arguing the responsibility of backward compatibility with him :p
01:33 preaction okay. if you thought my last tests were bad, now i need two mojo apps running and communicating with each other...
01:34 preaction ... via websockets
01:36 jberger Meh, piece of cake
01:36 preaction yeah, i imagine it'll just work, like most everything else in mojo
01:37 inokenty-w joined #mojo
01:39 preaction really this entire Mercury exercise is me seeing how much stuff _just works_ in mojolicious :p
01:39 sri those ==> operators would fit really well into perl5 https://github.com/tokuhirom/p6-Crust/blob/master/lib/Crust/Utils.pm#L15
01:41 sri "my %foo = map { ... } @bar" becomes "@bar ==> map { ... } ==> my %foo"
01:42 dave perl 6 is so pretty :)
01:45 * Zoffix prefers the my %foo = map { ... } @bar
01:45 sri haha, that module is pretty bad
01:45 Zoffix *
01:45 * Zoffix prefers my %foo = map blah, @bar
01:45 sri map without block is blasphemy!
01:45 dave to which god?
01:45 Zoffix Though WhateverStar blows my mind: https://twitter.com/zoffix/status/652184779756953600
01:45 jberger The old gods and the new
01:46 Grinnz that looks like smartmatch but even less well defined
01:46 * Zoffix is a bit freaked out about http://www.meetup.com/Toronto-Perl-Mongers/events/225031099/
01:47 sri oh, neat
01:47 Zoffix It's nice a Mojolicous talk is billed as "much requested"
01:47 SmokeMachine hi again!
01:47 Zoffix SmokeMachine, hello!
01:47 SmokeMachine Is there any way to "synchronize" events between servers?
01:48 jberger SmokeMachine: message brokers?
01:49 SmokeMachine jberger: something like that, but mojo native...
01:49 SmokeMachine ?
01:49 sri https://github.com/kraih/mojo-pg/blob/master/examples/chat.pl
01:49 sri closest we got
01:51 SmokeMachine sri: that's beautiful!
01:51 SmokeMachine any way to use mysql with that?
01:51 SmokeMachine any chance?
01:51 Grinnz Mojo::mysql has a similar example yes
01:52 sri much less efficient though, i believe
01:52 Grinnz yes
01:52 Grinnz i wouldn't use it for the pubsub, but if you're already using mysql i guess it'd work
01:52 SmokeMachine I thought that there wasn't a Mojo::mysql... :)
01:52 sri not maintained by the core team, but it exists
01:53 Grinnz there's also Mojo::Redis2 which has a similar example, if redis is simpler to setup
01:53 Grinnz the redis version should be very efficient too
01:53 sri https://api.metacpan.org/source/JHTHORSEN/Mojo-Redis2-0.24/examples/chat.pl
01:54 sri redis could be more efficient
01:54 bpmedley sri: I would donate to a kickstarter or similar so you could focus on open source stuff for a year.
01:54 sri :)
01:54 bpmedley I imagine quite a few would.
01:56 SmokeMachine sri: more then postgres?
01:57 SmokeMachine bpmedley: +1
01:57 bpmedley SmokeMachine: Mojo::mysql also supports pub/sub
01:58 Zoffix +1 too
02:12 asarch joined #mojo
02:13 kaare joined #mojo
02:25 noganex joined #mojo
02:25 good_news_everyon joined #mojo
02:25 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vCLyS
02:25 good_news_everyon mojo/master ad844a7 Sebastian Riedel: use a better site for SNI testing
02:25 good_news_everyon left #mojo
02:42 panshin joined #mojo
02:53 good_news_everyon joined #mojo
02:53 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vCLQj
02:53 good_news_everyon mojo/master 357ec06 Sebastian Riedel: test SNI support with cpanmin.us
02:53 good_news_everyon left #mojo
02:54 sri obvious choice in retrospect
03:17 preaction SmokeMachine: you could also use Mercury to do messaging without needing a database of something
03:17 preaction pure Mojolicious
03:17 SmokeMachine preaction: what's Mercury?
03:17 pink_mist . o O ( what's SNI? eh, I'll go google )
03:18 preaction SmokeMachine: https://metacpan.org/pod/distribution/Mercury/bin/mercury
03:19 preaction SmokeMachine: it's a message broker, so you don't need to use a database as a broker, you can sync directly
03:21 SmokeMachine preaction: looks good...
03:22 SmokeMachine about the Mojo::mysql... how can I connect it using dsn, username and password?
03:23 SmokeMachine Grinnz: ^^
03:24 bpmedley SmokeMachine: plugin Minion => {mysql => 'mysql://user:password@127.0.0.1/table'};
03:25 bpmedley Sorry, that's with Minion.. one sec.
03:25 SmokeMachine bpmedley: thanks
03:25 SmokeMachine np
03:25 SmokeMachine i got it!
05:41 cpan_mojo Mercury-0.005 by PREACTION https://metacpan.org/release/PREACTION/Mercury-0.005
05:57 Lee joined #mojo
06:21 panshin joined #mojo
06:27 omega https://metacpan.org/pod/Mojolicious::Command::daemon the Usage mentions "-m production", but the options don't mention it, and it doesn't seem to be handled in the code?
06:35 dod joined #mojo
06:43 vytas joined #mojo
06:44 sugar joined #mojo
06:57 bpmedley omega: https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Commands.pm#L83
07:02 omega ahh, thanks
07:04 trone joined #mojo
07:08 McA joined #mojo
07:10 AndrewIsh joined #mojo
07:17 eseyman joined #mojo
07:43 sivoais joined #mojo
07:45 jberger joined #mojo
07:54 panshin joined #mojo
08:04 vanHoesel joined #mojo
08:15 berov joined #mojo
08:25 dod joined #mojo
08:25 amon joined #mojo
08:30 Lucas1 joined #mojo
08:33 marcus omega: oh ye of little faith ;-)
08:34 omega marcus: haha, well, I would have added it to the documentation right under the example as well to avoid confusion :)
08:35 Vandal joined #mojo
08:35 panshin_ joined #mojo
09:13 dod joined #mojo
09:19 meshl joined #mojo
09:29 panshin joined #mojo
09:30 dod joined #mojo
09:33 gaunt joined #mojo
09:49 panshin joined #mojo
09:56 omega is the helper name "config" somehow reserved? if I add a helper called config, it says it replaces it, but if I cann $self->config in startup, it won't call my helper. if I name it conf instead, it works as expected?
09:59 Zoffix omega, yes, config is reserved: http://mojolicio.us/perldoc/Mojolicious/Plugin/DefaultHelpers#config
09:59 Zoffix conf should be fine; though I wonder why you have two configs...
09:59 nic bpmedley: You might be able to borrow some ideas (liveperl.us) from here: https://codility.com/programmers/challenges/
10:00 omega Zoffix: not really two configs, but I wanted a better interface to the config
10:03 Zoffix Ah
10:04 SmokeMachine joined #mojo
10:08 jontaylor joined #mojo
10:15 Lucas1 joined #mojo
10:17 sri omega: how would you document those global options?
10:18 omega sri: same as the other options?
10:18 sri for every single command?
10:18 omega yes?
10:18 sri even the ones where it makes no sense at all?
10:18 sri like "generate app"
10:18 omega well, no, if it isn't mentioned in the synopsis I wouldn't
10:19 sri so you would only add the options that are mentioned in the synopsis?
10:19 sri not all global ones?
10:19 sri even if they kinda make sense? like --home?
10:20 omega well, when I run `script/myapp help daemon`, it gets its help from the synopsis of that command right?
10:20 omega the fact that that doesn't mention -m or --home is weird for me
10:20 omega well, it mentions -m, but doesn't explain it
10:20 sri so come up with documentation conventions for us to use
10:21 sri you know how this works
10:21 marcusr well volunteered?
10:21 marcusr :)
10:21 omega I have to learn my lesson soon I guess yes.. never mention anything that feels weird
10:22 omega because if I don't have a perfect solution, it is apparently better to keep quiet
10:22 * marcusr pointedly ignores the weird mole on omega's chin
10:23 Zoffix I guess there *is* Mojo::DOM in p6: http://fpaste.scsys.co.uk/500084
10:23 Zoffix :P
10:23 bd or when people disagree with you they actually think about what you say
10:24 Zoffix Slow as molases though: real 4.098s
10:26 sri actually i was ready to commit a doc change, just waiting for instructions
10:26 * sri shrugs
10:27 omega well, I woudl document them where it makes sense? like if the script alters behaviour if I pass -m or --home, I would expect them to show up when I look for help for that script?
10:27 omega if they don't make sense, or don't alter the action of the script, then don't document them?
10:27 sri -h alters the behavior of all commands
10:44 asarch joined #mojo
10:47 deserted joined #mojo
10:48 deserted hey all, got a quick question on routes - what takes precedence, a wildcard route or a static file?
10:48 nic first one that matches
10:49 batman deserted: static files
10:49 nic sorry, misread the question
10:49 deserted thanks batman :) allg nic
10:49 deserted was hoping was the case, means I can do a psuedo rewrite with morbo for testing before deployment
10:50 batman deserted: static files are before _any_ routes
10:50 deserted batman, excellent, you saved me about half hour of digging through source to figure that one :)
10:51 batman deserted: i think it's documented here: https://metacpan.org/pod/Mojolicious#before_routes
10:51 deserted batman, damn, somehow completely forgot that ordering lol, #feelingstupidnow
10:52 batman don't feel stupid. not sure if that's the most obvious place to look for information.
10:52 batman just passed the link to you so you know to next time :)
10:53 deserted batman, no, but i've used before_dispatch to step around static's under conditions before, and it completely slipped my mind tonight
10:53 nic A great man once said, "On #mojo there are no stupid questions", which is why I joined
10:53 batman deserted: aha! been there :)
10:53 deserted nic fair point :)
10:54 deserted having fun doing my first angular app with mojo, so was looking for an easy way to simulate html5mode, wildcard route will be perfect :D
11:03 good_news_everyon joined #mojo
11:03 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vCqZV
11:03 good_news_everyon mojo/master 11a3f5b Sebastian Riedel: improve commands to show all options that can affect their behavior
11:03 good_news_everyon left #mojo
11:03 sri omega: so, like that?
11:04 neilhwatson joined #mojo
11:05 omega sri: well.. -h outputs help right? if it needs to be documented or not, I have no strong opinion on. My main confusion came from -m in the synopsis, but I would assume --home would also make sense for a lot of them
11:05 good_news_everyon joined #mojo
11:05 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vCqnc
11:05 good_news_everyon mojo/master cb28e53 Sebastian Riedel: fix command tests
11:05 good_news_everyon left #mojo
11:10 omega oh, didn't see the commit
11:10 omega yes, looks a lot better :)
11:14 panshin joined #mojo
11:17 panshin joined #mojo
11:19 sri mentioning everything that changes a commands behavior is a simple enough rule to follow
11:19 sri omega: that's all i was after
11:21 marcusr I like that rule too. +1
11:22 omega great great :)
11:23 sri remember, i'm german, we like rules... like a lot
11:24 marcusr sri is just a very complex rules engine.
11:27 nic There was some research a while back that found almost all of a community doctor's day-to-day decision making can be modelled by a 30-rule rules engine
11:27 nic Twas a bit of a shocker cos the assumption had always been that being a doctor was a lot more complex than that
11:28 * nic has time to chat cos his job was taken by a rules engine
11:29 Jonis morbo script -p 3001 would be a nice short for morbo script -l http://*:3001
11:29 marcusr nic: you had one job.
11:30 Jonis watson is diagnosing cancer these days, isn't it?
11:32 sri it's never lupus
11:32 deserted Jonis, only problem there is default behaviour is bind to localhost - you're not passing anything to change that behaviour, just a port change
11:32 nic I almost had a patent for a machine that could diagnose cancer with 100% accuracy, but it was deemed unethical to have a machine deliberately giving people cancer
11:32 nic <-- here all week
11:32 deserted ++nic
11:33 Jonis nic++
11:34 marcusr +nic+
11:34 sri n+i+c
11:42 jontaylor joined #mojo
12:28 elik joined #mojo
12:38 sugar karma mojo
12:38 sugar no karma bot here =))
12:39 sugar joined #mojo
12:40 ashimema is there any simple way to access a mojolicious config from a parallel module, without just slurping it in again?  I'm trying to join the dots on my db deployment scripts.. using DBIx::Class::DeploymentHandler via a Mojolicious::Command
12:40 ashimema I have a feeling I'm missing something obvious
12:42 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Adding-commands-to-Mojolicious
12:43 punter joined #mojo
12:45 ashimema So.. i've already for DeploymentHandler being invoked nicely via a command.. but it further down the line calls some further db related modules.. one of which I wan't to have access to the config
12:46 ashimema without doctoring the core deploymenthandler, I'm not sure how to pass the config along..
12:46 ashimema if that makes any sense
12:48 nic so the command has easy access to the config; are you asking how to pass it from there to some module further down the call chain?
12:48 ashimema yes
12:48 ashimema that's exactly what I'm asking :)
12:48 ashimema just struggling to articulate it
12:49 * ashimema has baby brain.. blomin' child not letting me sleep enough ;)
12:49 vytas joined #mojo
12:49 jberger sri: I wonder if there world be any appetite for putting the author time commands in another namespace?
12:50 jberger galileo needs a daemon command but would probably be better to not have a generate command
12:51 nic ashimema: If the target module doesn't have access to app, and you can't pass options in the invocation, you're stuck
12:51 ashimema thought that may be the case..
12:52 ashimema thinking I may add an export to my main app to in effect jsut export the config helper
12:52 ashimema no idea if that's a remotely good idea yet
12:53 bpmedley ashimema: $app = Mojo::Server->new->build_app("Howdy")
12:54 nic ashimema: perhaps an in-memory data store (eg redis)
12:54 nic bpmedley: He's asking how to avoid re-loading the config
12:54 bpmedley I need to read the entire question.
12:55 nic tbh I would just load the file again, if that's possible
12:55 ashimema I'm not totaly against reloading the config.. more want to mkae sure i'm using the same code to do the reload so the loading doens't fall out of sync
12:55 bpmedley nic: Thanks for the challenges link
12:55 nic np
12:57 bpmedley ashimema: Then, perhaps make a new app object and use the Config plugin?
12:57 ashimema looks like a good plan bpmedley..
12:58 ashimema I'm just reading the doc around Mojo::Server now to understadn your comment.. makingsure I understadn what you mean by it ;)
12:58 ashimema but that looks currently to be the missing link I was failing to work out myself :)
13:00 nic ashimema: If the calling code knows the path to the config file, there's a much lighter invocation you can use
13:01 aborazmeh joined #mojo
13:03 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Application-embedding
13:05 ashimema awesome!
13:05 ashimema thank you so much guys
13:05 nic I'm thinking that can be expensive if there're a lot of routes to set up, plugins to configure, etc
13:06 ashimema please elaborate nic.. my module can pretty trivially work out the config file path
13:06 nic you can call Mojolicious::Plugin::Config->new->load($file, undef, $app) where $app is a dummy app (perhaps Mojolicious->new would work)
13:07 ashimema ah.. that makes great sense too.
13:07 * ashimema is very happy now :)
13:07 nic (I use Mojar::Config for this, but it's up to you whether you want to add a dependency)
13:08 nic (actually, don't add a dependency; there's no guarantee the two modules will behave identically, which is what you need)
13:08 ashimema :)
13:09 bpmedley nic: $config = Mojolicious->new(moniker => "howdy")->plugin(Config => {file => '/abs/config.joy'})  <-- Will this do something similar using Mojolicious->new?
13:10 nic that doesn't quite work
13:11 bpmedley Why not?  Seems to work in the debugger.
13:11 nic if you add ->config it might work
13:12 bpmedley Were you able to run the code?
13:13 nic bpmedley: dumper($config)
13:14 bpmedley nic: I'm using the debugger and "x" to dump the return value of the statement.  I wonder what is different.
13:19 nic ah yeah, it does give back a hashref, I thought it might be a Mojolicious
13:33 ashimema :)
13:33 ashimema works a charm chaps.. many thanks
13:48 marcusr joined #mojo
13:49 HtbaaPi joined #mojo
13:50 mattastrophe joined #mojo
13:55 HtbaaPi_ joined #mojo
14:04 gryphon joined #mojo
14:09 lluad joined #mojo
14:15 PryMar56 joined #mojo
14:16 Kogurr joined #mojo
14:34 odc` joined #mojo
15:06 Dada_is_crazy joined #mojo
15:27 meshl joined #mojo
15:42 sri talking about embedded apps, i think we could get rid of mojo.secrets very easily
15:43 sri and improve security by decreasing the risk of secrets getting leaked through the stash
15:45 good_news_everyon joined #mojo
15:45 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vCmhM
15:45 good_news_everyon mojo/master 9642fb7 Sebastian Riedel: improve session security by not storing secrets in the stash
15:45 good_news_everyon left #mojo
15:45 sri this is much cleaner
15:46 sri the mount plugin just propagates the secrets of the host app
15:48 PopeFelix Before I start tearing my hair out, is it reasonable to expect a DESTROY method to be called the minute the refcount on an object goes to zero?
15:49 pink_mist I'd expect it to be done at a scope boundary
15:50 PopeFelix pink_mist, Yes, I would too.
15:50 PopeFelix So when the object goes out of scope, I should expect DESTROY to happen.
15:53 bwf joined #mojo
15:56 Grinnz_ as long as nothing else is referencing it strongly
15:56 ajr_ joined #mojo
15:58 PopeFelix Grinnz_, right. How do I tell?
15:59 sugar joined #mojo
15:59 pink_mist Devel::MAT might help you
15:59 Grinnz_ well... whether DESTROY gets called :)
15:59 pink_mist but I don't think there's an easy way to tell
15:59 pink_mist unless it's obvious
16:00 Grinnz_ beware of objects it reference which may reference back
16:00 Grinnz_ references*
16:02 PopeFelix Seems like DESTROY is getting called after the test exits.
16:19 panshin joined #mojo
16:22 batman PopeFelix: then you probably have a circular reference keeping the object alive
16:22 PopeFelix batman, yeah, probably.  Just got to figure out where.
16:23 batman PopeFelix: I use Test::Memory::Cycle
16:24 Lee joined #mojo
16:24 PopeFelix batman, that looks pretty cool. I'll try that.
16:29 PopeFelix Yep.
16:30 PopeFelix Memory cycle.
16:46 storskegg joined #mojo
16:50 storskegg good noonish
16:51 storskegg i'm liam, a front-end dev who works with jberger. normally i'd talk with him about minion things, but he's out today, and i need a little help
16:51 storskegg s/front-end dev/front-end dev who plays at perl/
16:56 storskegg so, we have mojo set up to push minion jobs to a postgres db, but at some point the minion.db has returned. we're returned a job id, but when i check on the job status by its id, i get "Job does not exist." I'm assuming it's querying PG for a job id that somehow was pushed into minion.db?
16:56 storskegg what i'm looking for is knowledge on how the minion.db file might come back (shouldn't exist in our instance) when we're supposed to be working through pg
16:57 storskegg from there i can see about how to fix the issue
16:57 stephan48 do you use the same code for initializating the Minion object at all places?
16:57 good_news_everyon joined #mojo
16:57 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vCY4h
16:57 good_news_everyon mojo/master f4049c1 Sebastian Riedel: do not encourage testing of custom transactions
16:57 good_news_everyon left #mojo
16:58 Grinnz_ by minion.db do you mean the file backend?
16:58 storskegg @Grinnz_ yes (sqlite, right?)
16:58 Grinnz_ DBM::Deep actually
16:58 Grinnz_ sqlite would be possible to do now, but there's no real reason for it yet
16:59 sri you specifically have to ask for the file backend, it won't just pop up on its own
16:59 Grinnz_ but yeah, it would be how you construct the minion object
16:59 storskegg stephan48, tbh i'm not super familiar with that area of the codebase, but i'd say it's a reasonable assumption that we do
16:59 storskegg ah, ok
17:00 sri there are no defaults, you can't even do Minion->new()
17:00 Grinnz_ https://metacpan.org/pod/Minion#new backend is required to be specified
17:00 storskegg Grinnz_ & sri, thanks. i'll ack for DBM::Deep, and see what find.
17:01 Grinnz_ you wouldn't see DBM::Deep directly, just the "File" backend like in that example
17:01 * storskegg looks
17:01 stephan48 maybe look at all Minion->new calls
17:02 storskegg already acking ;-) danke
17:02 sri if i had to guess, i'd say you have separate minion configurations for development and production, one using the file backend, the other using pg
17:02 sri and someone ran the app in the wrong mode
17:06 cpan_mojo Toadfarm-0.68 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Toadfarm-0.68
17:09 storskegg on a fangirl aside, i'm really enjoying the mojolicious framework. i've had to work in our legacy starman/plack/mason code, and mojolicious is far more intuitive to me as someone who merely plays at perl
17:10 storskegg so...thank you everyone for this awesomeness
17:10 genio \o/
17:10 sri \o/
17:12 storskegg sebastian, you're in germany, yeah?
17:12 sri yea
17:13 storskegg if you ever get to the states near chicago, pm jberger, who should pm me, and i'll buy you a beer
17:13 bpmedley storskegg: Did you find the reference that is calling the File backend?
17:15 storskegg @bpmedley: only Pg. there's only one declaration: my $minion = Minion->new(Pg => $global) where $global = $app->config('...'), which is set correctly to the Pg server
17:15 storskegg trying variants of my search
17:15 sri ever since i actually started collecting those beers people kinda stopped promising them to me :)
17:16 bpmedley storskegg: Is it well structured app, a Lite app, or something else?
17:16 storskegg full mojo app; i'd say it's well structured (jberger has brought a wealth of organization to our codebase)
17:17 bpmedley 5,123 Mojolicious ad impressions
17:17 storskegg oh, you know, i just caught something
17:17 storskegg brb
17:17 bpmedley storskegg: perl -d:Trace script/name  daemon 2>&1 | grep Minion | grep require  <-- Does that show anything?
17:21 storskegg @bpmedley: will have to run in a sec.
17:21 storskegg however, i may have come across the issue in our config.
17:27 jberger storskegg: did you find it?
17:27 jberger Remember we have two minions
17:27 storskegg hey joel.
17:28 storskegg yeah, i see that.
17:28 jberger See pm
17:28 storskegg yep
17:36 storskegg thanks, everyone, for your help. i really appreciate it. coming from the land of ecma and css, it's refreshing to experience the support the perl community provides
17:37 * jberger goes to the beach
17:43 cpan_mojo Paws-0.16 by JLMARTIN https://metacpan.org/release/JLMARTIN/Paws-0.16
17:44 panshin joined #mojo
17:45 Grinnz only 2 minions? http://vignette2.wikia.nocookie.net/despicableme/images/5/56/Minions3.png/revision/latest?cb=20140611180116
17:54 cpan_mojo Mojo-UserAgent-Mockable-1.00 by POPEFELIX https://metacpan.org/release/POPEFELIX/Mojo-UserAgent-Mockable-1.00
17:54 PopeFelix hey, look at that! I did a thing! ;)
17:55 bpmedley PopeFelix++
17:55 genio :)
17:55 PopeFelix Now to sit back and wait for people to break it. ;)
17:57 mattastrophe joined #mojo
17:57 flowdy joined #mojo
17:58 flowdy hello you all
18:01 trone joined #mojo
18:04 flowdy may I ask if there is anybody who knows how to setup sticky sessions on Mojolicious with Hypnotoad?
18:05 flowdy I know folks hate sticky sessions but ...
18:06 flowdy my user sessions are not serializable (complex closures involved)
18:07 genio So, you have multiple hypnotoads behind some sort of load balancer?  You're sharing the same secret with the hypnotoads?  (I'm probably missing the actual problem here)
18:08 good_news_everyon joined #mojo
18:08 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vCY7C
18:08 good_news_everyon mojo/master 734c774 Sebastian Riedel: better description for --home option
18:08 good_news_everyon left #mojo
18:10 lluad joined #mojo
18:10 flowdy no, what I have in mind is rather to have one hypnotoad that looks at the cookie and dispatches the request to the worker that has initialized the respective session.
18:12 sri sounds like a job for nginx
18:12 flowdy so nginx instead of hypnotoad?
18:12 sri and i think a more common strategy might be to hash the client ip and load balance based on that
18:14 flowdy users might sit behind a proxy, the ip strategy probably cannot do a good job in that situation.
18:21 flowdy my "almost-a"-solution (at least I imagine) is to have a normally configured hypnotoad responsible for sending static assets (images, css, js) that redirects the client to the same URL but with the portnumber of the independent mojolicious server daemon.
18:22 flowdy maybe nginx would do a better job than hypnotoad here
18:25 Lee joined #mojo
18:25 flowdy ... but would it scale better (more / less workers)
18:27 nic flowdy: where are your session data? db? perl memory? something else?
18:28 flowdy in a sqlite file, so, database yeah
18:28 flowdy no
18:28 flowdy the dynamic data is in memory
18:29 flowdy as any data finally is when it is 'productive'
18:30 flowdy it is optimized for speed and small memory footprint
18:31 bpmedley flowdy: http://stackoverflow.com/questions/26223733/how-to-make-nginx-redirect-based-on-the-value-of-a-header <-- Could you use something like this and set the header in a hook?
18:32 nic my first suggestion is what sri said
18:32 nic another approach is to put an id in all your urls
18:34 nic how will you survive hypnotoad reloads?
18:35 flowdy does it make a difference whether you read the cookie (read != inspect here) or the uri?
18:35 nic how will you accommodate a dead worker?
18:36 flowdy reload is no problem, the in-memory state can be reproduced from the database, it is just cpu-heavy
18:36 bpmedley flowdy: It depends, because if you use nginx to do the routing, then it would be easier (I assume) to route based on a header or url.
18:37 flowdy ah, okay
18:39 flowdy (btw: the users join by invitation so I can control the session initialization load.)
18:40 sri oh, i completely misunderstood the question
18:40 sri you only have one server?
18:40 flowdy yes, one machine.
18:40 sri sticky sessions usually involves multiple servers behind a load balancer
18:41 sri you cannot have sticky sessions based on hypnotoad workers, and you shouldn't
18:41 nic ye, I had assumed that's where we were
18:41 sri it's bad, don't do it
18:41 sri sticky sessions is for load balancing
18:41 flowdy okay, hm.
18:42 sri i was thinking of a bunch of hypnotoads behind an nginx load balancer
18:42 flowdy how does hypnotoad communicate with the workers? Isn't there a possibility to hook in the IO loop?
18:43 sri no
18:43 flowdy so, let's call it session-cookie-based dispatch hypnotoad to worker
18:43 sri you'd need a special server, based on an entirely different architecture
18:44 sri with an acceptor process, sending file descriptors of already accepted connections to workers via pipes
18:45 nic you could have multiple hypnotoads, each with one worker
18:45 sri hypnotoad is designed after nginx
18:45 flowdy what do you mean by server, a machine or a process?
18:45 sri so totally incompatible with that
18:46 sri no, an entirely new web server
18:46 nic but I'm not seeing the point of SS here
18:46 sri web server as in alternative to hypnotoad
18:46 sri written by yourself
18:47 panshin joined #mojo
18:47 sri and you have to use questionable modules like IO::FDPass
18:47 flowdy what a pity, can't effort it
18:47 sri but let me repeat, it's a bad idea, very very bad
18:47 flowdy yes, I see.
18:50 flowdy I do not want hassles. I neither want only one worker dealing with dozens of users. So I will go for one hypnotoad in companion with a couple of static workers = simple Mojolicious daemons
18:50 flowdy companion = company
18:51 flowdy the latter have their own ports open
18:51 neilhwatson joined #mojo
18:51 sri it sounds like you might be inventing problems
18:51 flowdy hypnotoad redirects the clients respectively
18:51 sri perhaps step back and explain what you're actually trying to achieve with all of this
18:52 flowdy okay
18:53 flowdy my application is intended to be installed locally on the user's machine
18:53 panshin joined #mojo
18:53 flowdy but I want a demo server to check the concept out on a webserver for all
18:55 flowdy so the user is not to install the tool just for testing if it meets his need
18:55 flowdy this is why I cannot plan with a server farm or things like that.
18:55 bpmedley flowdy: This is off the cuff - try docker for your demo.. :)
18:56 flowdy docker to be installed at client side? (please explain docker in short when I am wrong)
18:57 bpmedley I assume your demo would be accessible via the public internet, is that correct?
18:57 flowdy yes
18:58 bpmedley Spin up a docker that has your Mojo app listening on port 3000.  Then, port forward port 80## to the docker container.
19:00 flowdy what exactly should docker do?
19:00 bpmedley Actually, a better way to state that would be to allow port 80## to be accessible and publish the container's port to the host.
19:00 bpmedley flowdy: You could have a unique docker instance for everyone that wanted to demo your app.
19:01 flowdy okay, but how do I know when a docker instance is no more needed?
19:02 flowdy users shouldn't be ought to tell me by mail, I think
19:03 bpmedley There's a few ways to do that.  One is by simply removing demo apps that are 3 hours old, or somesuch.
19:04 bpmedley When I say "demo app" I mean a docker container.
19:07 flowdy how heavy is a docker instance in terms of system resources, compared to separate perl processes?
19:11 flowdy well, just reading wikipedia
19:11 bpmedley If I'm readying this correctly, the docker daemon is 33M and each image is ~10M  (RSS)
19:11 flowdy it reads docker relies much on linux kernel technologies
19:12 flowdy I will have a freebsd jail.
19:12 bpmedley I see.  Hrmm, my bad.  I assumed Linux for unknown reasons.
19:14 flowdy so I guess it's 1:0 for my hypnotoad-vs.-daemons port-number-based dispatch hackery stuff :-/
19:16 flowdy yes, we all I guess will not wait too long until I would be frustated with this poor man's solution
19:18 flowdy so I will start with one standard mojolicious daemon, hoping my app will not be the next big thing by tomorrow ;)
19:20 flowdy oh, I wouldn't need a dispatcher
19:22 flowdy I could simply offer enough links [demoserver1]..[demoservern], and randomize their order because most will click the first
19:23 flowdy a client-side javascript load balancer frankly
19:23 bpmedley https://github.com/brianmed/Minion-Backend-mysql <-- Anyone have time to test Minion::Backend::mysql and Minion 2.0?
19:23 preaction or you could sync the state between all the servers so that it doesn't matter which one the user connects to
19:24 fvox joined #mojo
19:25 Kogurr joined #mojo
19:26 flowdy preaction: thanks for the note, however, how to sync in-memory content if serialization does not work?
19:26 preaction there's no way to transmit the information at all?
19:27 flowdy can't think of any.
19:27 preaction then how can the information exist?
19:28 flowdy I would have to reverse the closure building somehow.
19:29 preaction so you're maintaining state through a closure. there are other ways to maintain state
19:31 flowdy the closure, as I said, is a very efficient thing once built.
19:31 flowdy yes, there is session data in a database but
19:32 preaction and it's impossible to build that anywhere else?
19:34 flowdy it needs parsing and the construction of potentially hundreds of objects, and calculation of bitvectors from what they hold again ...
19:34 flowdy it is possible to redo that on every other request
19:34 flowdy but it does not scale well.
19:36 preaction right, but if you can calculate what you can, serialize at some point, pass that to all the other things, and finish the work, you could copy the result to all the servers. and yes, at that point you'll need to weigh the performance costs
19:38 flowdy I will consider that. That is, I will have to, if the user base outgrows my expectations
19:40 preaction you could also move that stuff to another server, and just have the web server act as a gateway to the backend server
19:40 preaction so, yeah, like you were saying with session affinity
19:47 flowdy thank you; and thank you other guys, and sorry for my bad english, at least it seems you could understand me :-)
19:50 jontaylor joined #mojo
20:03 sivoais joined #mojo
20:06 cpan_mojo Minion-Backend-mysql-0.04 by BPMEDLEY https://metacpan.org/release/BPMEDLEY/Minion-Backend-mysql-0.04
20:40 dave http://www.programmerexcuses.com/
20:41 Grinnz_ heheh
20:41 Grinnz_ I've said most of these at some point
20:50 ZoffixW joined #mojo
20:52 pink_mist "I have never seen that before in my life" -- git blame: author: pink_mist
20:52 pink_mist d'oh
20:54 Grinnz_ hehe
20:54 KindOne joined #mojo
23:14 PryMar56 joined #mojo
23:32 jberger sounds like flowdy is making a one user webapp
23:33 jberger So the server isn't really a server, it's really just the entire desktop app that uses the browser as a gui toolkit
23:33 jberger See Farabi as an example
23:35 ajr_ joined #mojo
23:45 disputin joined #mojo
23:55 meshl joined #mojo

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary