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

IRC log for #mojo, 2015-10-29

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

All times shown according to UTC.

Time Nick Message
00:00 jberger sawtooth: flash uses the session cookie, should work just fine
00:02 jberger sri: would a memory backend work? Mmap some memory?
00:02 jberger Maybe best for sqlite
00:03 sri doubt it
00:03 sri and i doubt anything will beat sqlite
00:04 sri the advantage DBM::Deep had was no compiler
00:05 sri but databases are hard... and there is no free lunch
00:06 Grinnz i get free pizza at work sometimes!
00:06 sri :o
00:08 * Grinnz is really glad he added that ->last_insert_id hack to Mojo::SQLite
00:16 sri it's funny, if ssd drives didn't exist i'd have no problem readding the Storable backend
00:27 good_news_everyon joined #mojo
00:27 good_news_everyon [mojo] kraih tagged v6.26 at d0702e6: http://git.io/vWbzk
00:27 good_news_everyon left #mojo
00:29 good_news_everyon joined #mojo
00:29 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vWbz8
00:29 good_news_everyon mojo/master c17ef06 Sebastian Riedel: bump version
00:29 good_news_everyon left #mojo
00:39 Grinnz sri, i was actually getting test failures because the timestamps didnt change between a couple tests
00:40 Grinnz https://github.com/kraih/minion/blob/master/t/pg.t#L36 i had to change to >=
00:40 Grinnz and https://github.com/kraih/minion/blob/master/lib/Minion/Backend/Pg.pm#L193 i had to change to <=
00:42 Grinnz (job enqueued and then attempted to dequeue right after, got no jobs back)
00:49 sri that <= makes perfect sense
00:49 sri the test is... unfortunate
00:51 Grinnz yeah it's not really testing for a "new timestamp" anymore but i don't want to stick a sleep in there :P
00:52 sri yea, the test makes no sense if it is changed
00:53 sri guess it could do "$worker->register for 1 .. 50" to guarantee some time passes...
00:54 sri sleep might be correct though :(
00:56 Grinnz what is the concurrency issue for this test? https://github.com/kraih/minion/commit/d6c256c8b94b1e4a687b6036e79047025c943636
00:58 sri notifications
00:58 sri don't have a new way to test it yet
00:58 sri it just wakes up too early because it receives notifications from another test
00:58 Grinnz ahh
01:00 jontaylor joined #mojo
01:02 sri oh well, i'll sleep in the test, it uses usleep already anyway
01:09 Grinnz 500000 still fails on travis for me, lol
01:09 sri :O
01:10 sri wait, why are you running pg tests on travis?
01:10 Grinnz in sqlite
01:10 sri oooh
01:11 tyldum joined #mojo
01:11 sri well, then adjust the number
01:11 Grinnz https://travis-ci.org/Grinnz/Minion-Backend-SQLite/builds/88025278
01:11 sri precision mismatch is expected
01:11 sri that's not even sub second precision!
01:12 Grinnz hmm?
01:12 sri postgresql timestamps have microsecond precision
01:12 Grinnz oh!
01:12 Grinnz that makes more sense now
01:13 Grinnz i think i can get that from sqlite as well... let's see...
01:14 Grinnz hrm, not easily
01:15 sri it's not very important
01:17 sri Minion::Backend::mysql seems to have it though ;p
01:19 Grinnz yeah, it is a bit of a problem to do in sqlite, especially to store it
01:19 Grinnz because there is no real datetime types
01:23 Grinnz it looks like mysql only supports that in mysql 5.6.4+
01:23 Grinnz which explains why i didn't know about it haha
01:24 Grinnz we use 5.5-ish usually now...
01:24 sri ouch
01:25 Grinnz its a little annoying though, with the text representation of datetimes that sqlite uses, it *would* work if the datetime() function returned the fractional part
01:25 Grinnz like, transparently
01:26 Grinnz it already supports reading that format, the function just doesn't output it
01:28 * Grinnz tries something
01:29 * sri is really curious how fast sqlite will be
01:31 jontaylor joined #mojo
01:32 Grinnz damn, still can't get the query to output fractional seconds without a lot of nonsense
01:33 Grinnz oh well
01:38 * Grinnz wonders when DBD::SQLite will release that json support
01:53 cheesekun joined #mojo
02:01 cpan_mojo Minion-Backend-SQLite-0.001 by DBOOK https://metacpan.org/release/DBOOK/Minion-Backend-SQLite-0.001
02:04 * Grinnz hides
02:04 Grinnz you may want to use Mojo::JSON::MaybeXS in your benchmark, btw :P
02:32 zivester joined #mojo
02:33 sri heh, that was fast
02:34 sri Grinnz++
02:37 sri allright, this is the minion_bench.pl output here https://gist.github.com/anonymous/5e84f686faeef6e53957
02:38 mattastrophe joined #mojo
02:38 sri are there concurrency problems?
02:38 Grinnz hmm
02:39 Grinnz shouldn't be in WAL mode
02:39 sri https://gist.github.com/anonymous/292abcda1b1314795a43
02:39 sri what i used
02:40 sri fresh install of everything
02:44 sri what i end up with is exactly 2000 jobs in state active and the rest inactive
02:45 sri so 3 workers died in my last test
02:45 sri (results might differ slightly from the pasted ones)
02:45 Zoffix Well, this went very well.
02:45 sri i do like the numbers for the successful parts though :)
02:45 Zoffix batman++ They really seemed to like ::AssetPack (https://www.youtube.com/watch?v=FaPdlkkSvV8#t=2324)
02:45 * Zoffix saw eyes sparkle\
02:46 sri Zoffix++
03:06 kaare_ joined #mojo
03:09 zivester joined #mojo
03:23 inokenty-w joined #mojo
03:32 sri Grinnz: migth also be worth having a synopsis like this https://metacpan.org/pod/Minion::Backend::mysql#SYNOPSIS
03:33 sri bpmedley: haha, your description still mentions postgres ;p
03:33 Zoffix :P
03:34 Zoffix bpmedley, the ->new method description also got the PG URL
03:34 Grinnz sri, the problem goes away when i disconnect the parent process's DBH before forking
03:34 Grinnz :s
03:35 sri interesting
03:36 sri and odd considering you clear the connection queue after a fork
03:37 Grinnz yes, the only reason i tried it is because a tiny blurb in the sqlite docs says "Under Unix, you should not carry an open SQLite database across a fork() system call into the child process."
03:39 sri how are you even supposed to enforce that?
03:44 sri "You shouldn't (re)use a database handle you created (probably to set up a database schema etc) before you fork(). Otherwise, you might see a database corruption in the worst case."
03:44 sri that is confusing
03:44 sri perhaps it's just old dbhs not getting cleaned up correctly?
03:45 Grinnz i dont know, the only problems i've had with that previously were solved by AutoInactiveDestroy
03:45 sri also odd that it doesn't appear with the tests
03:46 sri they fork quite a bit, and even use a new dbh in the child process to set a job result
03:47 sri minion_bench.pl seems to mostly fail for 3 out of 5 worker processes
03:47 sri 2 always succeeded so far
03:48 Grinnz on my box i only got 1 sometimes, it's a centos box with very slow I/O
03:49 sri i guess we can conclude that at least for normal workers it is fine
03:49 sri oh wait
03:49 genio joined #mojo
03:49 sri worker command defaults to -j 4
03:50 sri if theres $job->... calls it might fail too
03:52 sri jobs like this http://mojolicio.us/perldoc/Minion#add_task
04:33 absolut_todd joined #mojo
04:40 absolut_todd joined #mojo
04:47 mattastrophe joined #mojo
04:50 irqq joined #mojo
04:56 aborazmeh joined #mojo
05:03 sri guess this will be how i isolate my tests that involve Mojo::Pg in the future https://github.com/kraih/minion/blob/master/t/pg_lite_app.t#L18
05:07 Zoffix joined #mojo
05:10 irqq joined #mojo
05:10 mattastrophe joined #mojo
05:11 mattastrophe joined #mojo
05:26 bw joined #mojo
06:01 mattastrophe joined #mojo
06:16 mattastrophe joined #mojo
06:26 * crab ponders porting @apps to 6.latest
07:00 trone joined #mojo
07:33 Vandal joined #mojo
07:38 bjoernfan joined #mojo
07:59 mattastrophe joined #mojo
08:05 eseyman joined #mojo
08:16 meshl joined #mojo
08:20 romel hey everyone. what if i want to retreive a large gzipped text response from http with Mojo::UserAgent. should i assign IO::Uncompress::Gunzip object as handle for received asset file?
08:20 berov joined #mojo
08:26 romel well seems it's a wrong assumption
08:34 bpmedley romel : Are you uncompressing the gzipped text as you go?
08:34 bpmedley sri++, Zoffix++ # Thx for mentioning the PostgreSQL blurbs in the .pod.  I'll update git.
08:38 shadowpaste Someone at 217.168.150.38 pasted "#!/usr/bin/env perl use Mojo::" (13 lines) at http://paste.scsys.co.uk/500582
08:39 romel bpmedley: that's what i'm trying to achieve :) now i ended up with something like that http://paste.scsys.co.uk/500582
08:40 bpmedley romel : http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Streaming-response <-- Did you see this?
08:42 romel yea, i guess :)
08:43 bpmedley Does that mean you think the recipe might work for your scenario?
08:44 romel definitely
08:44 romel thank you
08:44 bpmedley You're welcome
09:30 irqq joined #mojo
09:52 jontaylor joined #mojo
09:58 dvinciguerra joined #mojo
11:37 asarch joined #mojo
11:44 tencendur joined #mojo
11:48 jabberwok joined #mojo
11:49 tencendur_ joined #mojo
12:02 hernan605 joined #mojo
12:13 neilhwatson joined #mojo
12:36 ajr_ joined #mojo
12:40 Quai joined #mojo
12:48 Quai what is the best way to broadcast data to (all) connected websockets? create my own custom event, and subscibe to it for each new connection, and emit() when needed?
12:58 Zoffix There's pubsub in Mojo::Pg :)
12:58 Zoffix (and the distro has an example of a websocket chat app; you can probably just steal that code)
13:00 Quai yeah, pubsub from pg or redis is next step, but currently it is a single process app :)
13:00 Grinnz there's an example in the Mojolicious dist itself for pubsub via EventEmitter
13:00 Grinnz that only works in a single process app
13:02 Quai ah, thank you.
13:03 Quai (I'm using mojo+ws to control a MIDI device :P)
13:07 HtbaaPi amazing, there's already a Minion::Backend::SQLite and ::File has been moved out of the core.
13:08 HtbaaPi I still like the File backend for local development stuff. But SQLite can do that just as well
13:09 HtbaaPi but indeed, even with a couple of thousands of jobs a day the File backend is not good enough. I noticed the slower execution of jobs as well
13:13 Zoffix :)
13:14 espent joined #mojo
13:16 PryMar56 joined #mojo
13:18 tencendur joined #mojo
13:30 gryphon joined #mojo
13:34 mattastrophe joined #mojo
13:37 arthas joined #mojo
13:40 jberger Quai: preaction is working on some pure mojo message broker stuff
13:40 jberger It's a little early yet
13:40 jberger Zoffix++ going to watch the talk this morning
13:54 cpan_mojo Mojolicious-Plugin-YamlConfig-0.2.1 by DATA https://metacpan.org/release/DATA/Mojolicious-Plugin-YamlConfig-0.2.1
13:58 genio Zoffix: Do you have a link somewhere to your talk?
14:06 asarch joined #mojo
14:11 jberger Zoffix: are you alex beamish?
14:16 jberger ah, no your talk is second
14:17 jberger though I now do know your name :-P
14:17 genio jberger: URL?
14:17 nic stalking is part of our terms of service
14:17 jberger https://www.youtube.com/watch?v=FaPdlkkSvV8
14:18 meshl joined #mojo
14:34 osfabibisi joined #mojo
14:38 jberger Zoffix: I like the order that you presented those modules in
14:53 bpmedley Quai : https://github.com/preaction/Mercury <-- Would this help?
14:55 sh4 joined #mojo
14:59 sri does anyone understand this? https://github.com/kraih/mojo/issues/861
15:02 nicomen sri: understood, ran pstree --help, answered
15:02 sri nicomen++
15:03 dvinciguerra joined #mojo
15:07 nicomen it might seem that we are not using the same 'pstree' command though, but hopefully -l on his also avoids truncating long process names
15:12 zivester joined #mojo
15:19 Samysam joined #mojo
15:19 lluad joined #mojo
15:20 dvinciguerra joined #mojo
15:21 Samysam Hello all. I'm using mojo and authentication plugin. How can I invalidate a user session (when I delete the user) ?
15:25 nic I think there's a ->logout
15:25 Grinnz_ sri: it seems the examples/entities.pl does not generate the entities lines in Mojo::Util's data section which don't end with ';', are these manually added?
15:26 Samysam nic: It's not the user itself but for exemple the admin user who delete another user
15:27 Grinnz_ aha, you want to invalidate someone else's active session
15:27 nic Samysam: so you must have something that checks whether the user has been deleted?
15:28 Samysam yes, but the authentication plugin doesn't re-check every request, it keep it in session
15:28 sri Grinnz_: looks identical to me
15:28 Grinnz_ what "authentication plugin"?
15:28 Samysam http://search.cpan.org/~madcat/Mojolicious-Plugin-Authentication-1.26/lib/Mojolicious/Plugin/Authentication.pm
15:29 nic Samysam: It's in the user's cookie
15:29 kes joined #mojo
15:29 nic so you need to handle "check whether we've deleted/disabled this user since we last saw this cookie"
15:29 bpmedley Samysam : http://search.cpan.org/~madcat/Mojolicious-Plugin-Authentication-1.26/lib/Mojolicious/Plugin/Authentication.pm#logout <--How does this not work for you?
15:30 Samysam bpmedley: I want a user to delete another one, not the user to delete itself
15:30 nic the usual pattern is to store a user id in the session/cookie, and load the user data from somewhere
15:30 Samysam ok, so I have no way to do that without checking the database for each user at each request ?
15:30 Grinnz_ sri: http://paste.fedoraproject.org/284868/46132637
15:31 nic at the 'load' stage, you fail cos they've been disabled
15:31 Grinnz_ diff between Mojo/Util.pm and the new generate text file
15:31 sh4 joined #mojo
15:32 sh4 joined #mojo
15:32 Grinnz_ sri: did the whatwg table used to have entries without ; ?
15:33 Samysam Ok, thanks, I will do that
15:33 sri Grinnz_: oh
15:33 sri yes it used to
15:34 Grinnz_ sri: also they have this now https://html.spec.whatwg.org/entities.json
15:35 Grinnz_ that doesn't have those entries either though
15:36 sri marcusr: see, and this is where inlining entities into Util.pm comes back to bite us
15:42 jberger hmmmm, the third presenter got something wrong about Mojo::IOLoop::Delay
15:43 jberger he claims that the next step's arguments are not guaraneteed to be in a known order :s
15:43 dvinciguerra joined #mojo
15:48 jberger email sent
15:48 sri so, is the semicolon now required in entities?
15:48 sri or are there new parsing rules?
15:52 hernan605 joined #mojo
15:52 hernan605 joined #mojo
15:53 sri hmm
15:53 sri "For example, the parsing of certain named character references in attributes happens even with the closing semicolon being omitted."
15:53 sri this is still there
15:53 Grinnz_ but it doesn't say which?
15:53 nicomen do you think that backwards-compatibility will change?
15:53 sri "To avoid this problem, all named character references are required to end with a semicolon, and uses of named character references without a semicolon are flagged as errors."
15:53 nicomen oh cool
15:54 Grinnz_ ah, so they actually consider it an error now
15:55 sri so, what should we do?
15:56 Grinnz_ i noticed that HTML::Entities will not expand entities without ; unless you use _decode_entities with $expand_prefix
15:56 Grinnz_ but that module is quite out of date, so
15:56 sri i guess we can be strict, which is faster
15:58 Grinnz_ have you seen https://metacpan.org/pod/release/EXODIST/Test-Stream-1.302020/lib/Test/Stream/Manual/FromTestBuilder.pod ?
15:58 Grinnz_ some very interesting changes if it's made core
15:59 Grinnz_ is, like, ref_is, and the warning/exception tests
15:59 jberger <3 context
16:00 jberger Test::Builder::Level sucks so much
16:00 Grinnz_ i dont know anything about that heh
16:00 jberger I waited so long before releasing Test::Mojo::Role::Phantom hoping that Test::More with context would come out
16:00 Grinnz_ i also saw theres a new set_encoding so you can keep the output from complaining about wide characters all over the place
16:00 Grinnz_ hehe
16:01 jberger and I finally had to work around it so that I could release before YAPC::NA 2015
16:01 Grinnz_ well Test::Stream is considered stable now http://blogs.perl.org/users/chad_exodist_granum/2015/10/teststream-going-stable.html
16:01 Grinnz_ just a matter of testing everything with it :P
16:02 jberger Test::Stream is stable, but Test::More doesn't use it under the hood yet
16:02 Grinnz_ right
16:02 jberger so Mojo can't use it yet
16:02 Grinnz_ i mean, testing everything on cpan, as a test of Test::Stream :P
16:10 kes Hi. I run my app like: hypnotoad myapp.pl, but the configuration file 'myapp.conf' is not recognized by hypnotoad. How to fix?
16:13 dvinciguerra joined #mojo
16:14 nicomen MOJO_HOME=..
16:20 good_news_everyon joined #mojo
16:20 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vWp1C
16:20 good_news_everyon mojo/master 27a61f7 Sebastian Riedel: update HTML5 entities in Mojo::Util
16:20 good_news_everyon left #mojo
16:20 sri we just follow the spec
16:20 Grinnz_ works for me
16:24 jberger CounterClockwiseContourIntegral :o
16:24 kes nicomen: MOJO_HOME does not work (
16:25 jberger kes: you are using the Config plugin?
16:26 kes jberger: no. I just run applications by server. I must not change them.
16:27 jberger kes: something must be loading the plugin or else it won't happen
16:27 kes jberger: and it seems I can not feed config to hypnotoad without hacking applications ((
16:27 jberger if the application does not accept configuration, then no, you can't
16:27 kes hrrr... ((( but production.log says nothing about that something does not work
16:28 jberger why would that be expected to log?
16:28 good_news_everyon joined #mojo
16:28 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vWpSm
16:28 good_news_everyon mojo/master 3b377ad Sebastian Riedel: more consistent references to encodings
16:28 good_news_everyon left #mojo
16:29 jberger I made a misstatement earlier: "kes: something must be loading the **config file** or else it won't happen"
16:29 kes I suppose that the application and server are two different programs. So I want to configure server without no configuration for application
16:30 kes I try to findout something: hypnothoad -c server.conf myapp.pl
16:30 kes but it seems that hypnothoad and myapp.pl is monolith
16:30 kes %-(
16:32 jberger kes: if you use the bundled Config plugin it will look for configuration in the application's home directory or else in the path specified by MOJO_CONFIG as seen here: http://mojolicio.us/perldoc/Mojolicious/Plugin/Config#file
16:32 jberger hypnotoad cannot use command switches because of the way that hot-reloading works
16:32 jberger environment is the only acceptable solution unfortunately
16:34 kes does I understand right? I must complete two steps:
16:34 kes 1. set MOJO_CONFIG
16:34 kes 2. load plugin COnfig in myapp.pl
16:36 jberger yes that is one possible solution
16:37 jberger if you want different instances to use different config, including some with no config, be sure not to use the default config name otherwise some may pick it up accidentally
16:38 kes >why would that be expected to log?
16:38 kes I expect see warn that the MOJO_CONFIG is setted up, but the config is not loaded because of plugin must be loaded manually
16:39 sri the app developer makes those decisions
16:39 sri get in touch with the app developer and request that they give you more config options
16:40 sri hypnotoad is not a general purpose web server, it is an app server, and the app developer controls what it does
16:41 kes maybe it will be more clear to run ./myapp.pl hypnothoad?
16:42 sri that's not possible
16:42 sri because of how operating systems work
16:48 jberger kes: on my servers, the startup scripts for each service define the environment that their hypntoad instance runs
16:48 jberger this works out nicely
16:48 nic maybe kes could write a MyApp::Command::hypnotoad that has that invocation and does what they want
16:48 jberger nic: that is not possible
16:48 jberger if it was we would have done it already
16:48 jberger the closest is the prefork command
16:48 jberger but that does not allow hot restarting of the servers
16:49 jberger hypnotoad is prefork command + hot restart
16:50 nic jberger: I don't see the "that is not possible", can you explain?
16:50 jberger the way the manager process mechanism works
16:50 jberger the process has to be external to your app
16:51 jberger its the same reason that morbo is an external command
16:51 jberger morbo is daemon command + restart on file system changed
16:51 nic hmm, I'll have a play tonight and see if you're right
16:51 jberger there is a manager process that watches for the file system changes and it must be external to your app in order to function correctly
16:51 jberger nic: you're welcome to try
16:52 jberger but I would be surprised
16:52 kes May be run internall process for myapp.pl?
16:52 nic you're saying that a mojolicious command can't exec another process like hypnotoad, and I don't see why it has that limitation
16:52 jberger how do you then issue the hot restart command?
16:52 nic kill
16:52 jberger to what process do you do that, and how does the new manager process replace it?
16:53 nic the location of the pid is in the app's cfg
16:54 kes jberger: you say we must have two commands: <manager> <application>, do not you?
16:54 Grinnz_ 12:48:04           <jberger> kes: on my servers, the startup scripts for each service define the environment that their hypntoad
16:54 Grinnz_ instance runs
16:54 Grinnz_ I also do this
16:55 jberger kes: yes
16:55 kes Grinnz_: ok, thank you. I will try
16:55 kes jberger: we can run ./myapp.pl myapp.pl
16:55 Grinnz_ kes: then your app would already be loaded in the manager
16:56 kes it is not be loaded, if we will use same code as hypnotoad has
16:57 jberger sorry, I'm too busy to argue the semantics of the preforking+hot-reloading application server atm
16:57 jberger if you want to try to reimplement it elsewise go ahead
16:58 nic jberger: before you go, do you still say a mojolicious command can't exec a separate process?
16:58 jberger fwiw, this was my only contribution to hypnotoad, it took all night to figure out, it fixed a very real problem, do you see it? https://github.com/kraih/mojo/commit/890aa77fbd71ca4e8ff1329cc88c0767f09ec739
16:58 jberger nic: not at all
16:58 nic heh, that saved me some time ;)
16:59 jberger the question isn't whether you can make a ./myapp hypnotoad either btw
16:59 nic that was exactly the question
16:59 jberger its how do you pass arguments to it across multiple invocations for hot restarting
16:59 nic you said it wasn't possible
16:59 jberger no, I said that hypnotoad implemented as a command (for the puposes that kes wanted) is not possible
17:01 jberger I've hacked an application script to abuse the env vars passed around
17:01 jberger that is possible
17:01 jberger but its worse than the correct solution
17:01 kes I am ambigious about that we start a server and the application (which is started by server when http request arrive) take care about the server configuration
17:02 kes the server is configured by application started by server %-(
17:03 jberger the application is not started when the request arrives
17:03 jberger unless you are running in CGI mode, in which case, you aren't using hypnotoad
17:05 kes I has no matter when application is started.
17:06 kes The design when child application configure parent is ambigious a bit (not expected). And DOC says nothing about that.
17:07 kes May I feel free to open the issue with description about missed info?
17:07 jberger what missed info?
17:08 kes <kes> does I understand right? I must complete two steps:
17:08 kes <kes> 1. set MOJO_CONFIG
17:08 kes <kes> 2. load plugin COnfig in myapp.pl
17:08 jberger the application can define configuration without ever loading a config file
17:08 jberger therefore the application itself has to be started to inspect the configuration
17:08 jberger there is nothing ambiguous about it
17:09 dvinciguerra joined #mojo
17:09 kes is hypnotoad server?
17:11 sri in the same way node.js is a server
17:13 kes Mojo::Server::Hypnotoad is a full featured, UNIX optimized, preforking non-blocking I/O HTTP and WebSocket server,
17:14 kes DOC says it is. Starting from that it forces me to thing I can configure the server by some way
17:14 kes *to think
17:14 sri it doesn't say anything about config files
17:15 jberger https://www.youtube.com/watch?v=FaPdlkkSvV8&amp;feature=youtu.be&amp;t=3328
17:15 jberger see, its in the talk we were just discussing this morning
17:15 kes http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Hypnotoad
17:16 kes Or just add a hypnotoad section to your
17:16 jberger config != config file
17:16 kes configuration file.
17:16 jberger no, you left out an important detail
17:16 kes And no one work about that application must load 'config' plugin
17:16 jberger to the configuration file passed to the config plugin
17:17 jberger yes that could possibly be changed to simply say that it looks at the config, but most people do use the config plugins
17:17 kes Yes, I left out it. Because I newbie to Mojolicious
17:17 * jberger really has to get back to $work
17:18 kes so can I open such issues?
17:18 jberger rather than doing that, why not just do what it tells you?
17:18 jberger you are always free to open an issue, but we have told you what the answer is
17:19 jberger just above that quote you gave is the other side
17:19 jberger Many configuration settings can be tweaked right from within your application with "config" in Mojo, for a full list see "SETTINGS" in Mojo::Server::Hypnotoad.
17:19 jberger I don't know what change to the docs could make that clearer
17:20 kes I will try to describe that in the issue
17:20 kes Thank you for your time and help
17:20 jberger the general answer is shown (change the configs however you want) and then the easy answer is shown (just use the config plugins)
17:23 sri kes: the issue will most likely get closed right away, since half the core team already agrees that the docs are clear enough
17:27 Samysam joined #mojo
17:31 kes You are developers. And from you point they are clear, because you know many aspects of the system. Newbie know only that the doc says. It was unclear to me: How to configure hypnotoad When I run application: http://mojolicio.us/perldoc/Mojolicious/Guides/Growing#Foundation
17:32 sri kes: we get a lot of user feedback, and you are the first so far to stumble over that
17:33 sri so, we have to assume that the current docs on the subject work for the majority
17:33 asm35 joined #mojo
17:33 kes Yes, docs great
17:34 kes but has not all answers yet
17:34 sri if it happens more than once we make changes pretty quickly
17:34 jabberwok which is also to say -- Write an article or a blog-post about How to Overcome This Little Thing and let's get it linked from the official docs or perl.org etc.
17:36 jabberwok i certainly had plenty of frustration moments and Explaining To Others is the best way to understand it yourself, and help the next n00b.
17:42 good_news_everyon joined #mojo
17:42 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vWh3m
17:42 good_news_everyon mojo/master 60e8a4f Sebastian Riedel: improve Mojo::Server::Prefork to log if the process id file could not be created (closes #862)
17:42 good_news_everyon left #mojo
17:43 sri the exception was not tested, so i just added the log message as well ;p
17:44 kes fantastic, you have fixed it so fast. great!
17:44 disputin joined #mojo
17:45 good_news_everyon joined #mojo
17:45 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vWhs2
17:45 good_news_everyon mojo/master e487cc9 Sebastian Riedel: log it as an error
17:45 good_news_everyon left #mojo
17:49 good_news_everyon joined #mojo
17:49 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vWhZA
17:49 good_news_everyon mojo/master 91f359f Sebastian Riedel: no need to print errors to STDERR too
17:49 good_news_everyon left #mojo
18:01 doby joined #mojo
18:15 punter joined #mojo
18:34 sri kes: please don't use github issues as a support forum
18:34 sri we have a mailing list and this channel for that
18:36 kes I don ask support there. I understand the problem (you have told me here). I test the synopsys and it does not work. I report about that.
18:37 sri you're making assumptions
18:37 sri and then report that your assumptions were wrong
18:38 kes if you think so. I will not do that
18:40 sri it's literally what you did here https://github.com/kraih/mojo/issues/864
18:40 sri you assumed ->configure would do something with a config file, which is mentioned nowhere, and then complain that it doesn't give you an error message because your assumption was wrong
18:41 romel hi guys. has anyone ever succeeded with gungzipping response stream on the fly?
18:42 sri romel: content encoding?
18:42 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Streaming-response
18:44 romel yes, i'm trying to read it with IO::Compress::Gunzip using the approach described there but it works for only first chunk of data
18:45 romel so i started thinking it's impossible due to nature of gzip format
18:49 asarch joined #mojo
19:07 trone joined #mojo
19:08 kes sri: I have updated examples. Hope you will see the problem...
19:10 batman Zoffix: thanks for showing off assetpack :)
19:11 kes sri: is is possible to clear doc in such way it will not possible make peoples wrong assumptions?
19:29 meshl joined #mojo
19:30 irqq joined #mojo
19:32 jberger kes: the only assumption you seem to be making is that configuration file is synonymous with configuration
19:32 jberger which is not true
19:37 Grinnz_ the Config plugin must be used if you use a config file for the Config plugin
19:37 Grinnz_ not really sure where that's unclear
19:37 Grinnz_ you can use JSONConfig instead
19:38 Grinnz_ or any other config plugin you find or write
19:38 Grinnz_ oh, and he's gone
19:49 jberger I never know what to do about someone like that
19:49 jberger I believe that they were truly confused, and yet ...
19:51 neilhwatson joined #mojo
20:04 sri so, any more feature requests for minion 3.0?
20:10 CandyAngel sri: like the ability to add arguments on retry?
20:10 sri yes
20:11 sri not that i believe it has much of a chance ;p
20:11 CandyAngel :P
20:11 sri *but* i do mean requests like that :)
20:13 sri what's the use case for changing args anyway?
20:16 CandyAngel You have a job that tries to access a resource which randomly requires credentials (say, completing a riddle or providing a password). You could just retry the job after providing it the password
20:16 CandyAngel Rather than queuing another job
20:19 sri a feature that interests me more currently would be auto-retry
20:24 sri i think it could be done reasonably well in Minion::Job::fail
20:24 sri perhaps with an attribute in Minion to calculate the new delay
20:25 sri and a new field in the database for the number of auto-retries
20:26 sri i kinda like the sidekiq formula (retry_count ** 4) + 15 + (rand(30) * (retry_count + 1))
20:26 sri which results in 15, 16, 31, 96, 271, ... seconds + a random amount of time
20:28 sri $minion->retry_delay(sub { ($_[0] ** 4) + 15 + (int(rand 30) * ($_[0] + 1)) });
20:28 sri as the default
20:37 sri would be very little for backend authors to do
20:39 sri of course the biggest open problem is still list_jobs
20:39 * sri pokes jberger and bpmedley
20:39 bpmedley Sorry, I hope to have some time this weekend to do more UI work.
20:41 jberger I think filter by queue is a clear win
20:41 sri problem with filter by queue is still that we have no list of queues
20:43 sri there is also no sorting in list_jobs
20:44 jberger meaning that you might request a list of jobs in a queue that does not exist?
20:44 sri meaning you can't have a pull down with queues
20:44 sri you have to enter the queue
20:45 sri everything else is known in advance, like states and tasks
20:46 sri (jobs are always ordered by id currently btw.)
20:46 sri we also have no queue specific stats, just overall stats
20:50 ajr_ joined #mojo
20:50 jberger getting a list of the currently defined queues wouldn't be hard
20:50 jberger SELECT queue FROM jobs GROUP BY queue
20:51 sri sure, but you have to fit it into the api
20:51 sri and possibly put an index on queue
20:57 trone_ joined #mojo
21:00 meshl joined #mojo
21:01 sri hmm, auto-retry seems to fit in really well now
21:01 espent_ joined #mojo
21:22 disputin joined #mojo
21:44 bpmedley_ joined #mojo
21:55 CandyAngel github, why you so weird
21:55 CandyAngel This pull request has a random commit that doesn't do anything on it as well
21:55 CandyAngel Not sure if it is going to do something weird if I accept it
21:56 Zoffix :)
22:07 Zoffix jberger++ # following up on Mojo talks and offering corrections and extra info
22:11 jberger CandyAngel: is this a public repo?
22:11 jberger I'm pretty adept at identifying PR problems, $boss can't really grok git
22:12 CandyAngel jberger: Yeah. https://github.com/CandyAngel/perl-openhmd
22:13 jberger CandyAngel: its the merge commit
22:14 jberger you could rebase it against your develop branch, but it won't cause problems
22:15 d4rkie joined #mojo
22:15 CandyAngel Hmm
22:15 CandyAngel I wonder why that happened, the change should have been done on that merge anyway
22:15 CandyAngel Ohhhhhh... I know
22:16 CandyAngel I hadn't pushed the develop branch with that merge on it, I guess he made a "new" develop branch
22:16 jberger https://github.com/CandyAngel/perl-openhmd/network
22:16 jberger right
22:16 jberger look where (s)he forks from
22:16 jberger I guess you said he
22:17 jberger gitflow ... does this
22:17 CandyAngel Can I just.. delete the request and him refork?
22:17 CandyAngel And submit it again properly?
22:17 jberger (I'm assuming gitflow, since "develop")
22:17 jberger you can just rebase it and merge it
22:17 jberger but if you are doing gitflow then git used to messy merge history
22:18 jberger *get used
22:18 jberger or ask them to rebase
22:18 CandyAngel I'm not using gitflow tool, but I am following the branching model nvie posted
22:19 jberger I do a hybrid where I rebase my topic branches against develop(ment) before issuing the merge PR
22:19 jberger I also hate the name develop, so I call mine development, because, grammar
22:19 CandyAngel :)
22:34 * sri has a full patch for automatic retrying of jobs https://gist.github.com/anonymous/c5ade3275a15f1aad34f
22:37 sri main implementation is in Minion::Job::fail https://gist.github.com/anonymous/c5ade3275a15f1aad34f#file-retry-diff-L259
22:39 sri nothing changes unless you set the attempts option
22:40 sri if you do ->enqueue(foo => [] => {attempts => 25}) it will be retried 25 times with increasing delays
22:41 sri (actually 24 times, the original attempt counts too)
22:48 circ-user-Sar4c joined #mojo
22:48 sri only thing i'm not sure about is ->fail using two backend methods, so there's room for errors
22:49 sri like someone calling die in a failed event
22:49 sri and preventing the retry
22:49 CandyAngel -.-
22:49 CandyAngel Why can't it just move develop to that commit -.-
22:50 lluad joined #mojo
22:50 circ-user-Sar4c Hello everyone. Are newbie questions welcome here?
22:50 CandyAngel Heyas circ-user-Sar4c
22:50 CandyAngel And they sure are
22:50 CandyAngel Ask away :)
22:51 sri pushed into a branch for now, if nobody cares it will stay out of 3.0 https://github.com/kraih/minion/compare/auto_retry
22:52 circ-user-Sar4c Great. I have been trying to find a simple solution to my problem (having a bunch of processes connect to a server using websocket and periodically (every 3-5 seconds) push out some stats. The server is already written and functions well. Its the client that Im stuck with. The only example
22:53 circ-user-Sar4c The only example I found is http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#USER-AGENT, but I am only able to send one message with the code.
22:54 circ-user-Sar4c If I use a simple for loop, the messages don't seem to be reaching the server.
22:54 circ-user-Sar4c Is there a place I can post my code for y'all to see?
22:57 sri gist.github.com
22:59 circ-user-Sar4c in a nutshell, I am creating a new websocket :
22:59 circ-user-Sar4c $ua->websocket('ws://127.0.0.1/ws/upload_data?publish-broadcast' => sub {
22:59 circ-user-Sar4c Then I, as the example suggests, define the handlers for events.
23:00 circ-user-Sar4c Finally, if I use $tx->send (as is in the example), the string reaches the server and all is well. But, if I use a for loop to construct the string and then try to send it, they (2nd onwards) don't seem to be reaching. Only the first one reaches.
23:05 circ-user-Sar4c Oops. missed seeing Sri's suggestion amidst my jots... Will post and link here...
23:11 circ-user-Sar4c https://gist.github.com/anonymous/353770490825ebb132ff
23:14 CandyAngel jberger: Thankies for your help. I got it to do it nicely now :)
23:16 sri circ-user-Sar4c: ->send does not send a message right away, it's only written to a cache, and will be written later when the event loop is in control again
23:16 sri s/cache/buffer/
23:17 circ-user-Sar4c Oh, that makes sense... So, is there a function that sends the message/string right away without caching?
23:18 circ-user-Sar4c And, I guess, the event loop does not gain control when the for loop is running... makes more sense...
23:19 sri no, that's not possible
23:20 sri such a send operation would have to block, which defeats the purpose of an event loop
23:21 circ-user-Sar4c Actually, I am okay even if it is blocking.... This is a pretty passive script and things won't happen while it is blocked...
23:22 sri Test::Mojo has a kinda blocking implementation, there is no generic version though
23:23 circ-user-Sar4c Okay. For my understanding, when are a buffered list of messages actually sent?
23:24 circ-user-Sar4c (in a non-blocking context)
23:24 sri when the event loop is in control
23:24 sri so, never in your code
23:24 circ-user-Sar4c Hmm... Or, atleast until the entire for loop runs out....
23:27 circ-user-Sar4c May be an odd question here, but do you know of any simple modules I could use to accomplish this? As you can see in the code, all I want to do is connect, and periodically keep sending data. More like a http useragent, except this is a websocket (as I want to avoid the multiple connect/disconnects of a Http POST method)
23:27 sri no
23:28 * sri wonders why there is so little interest in automatically retried jobs
23:28 bpmedley_ circ-user-Sar4c : Are you having issues with a CLI client, I wager?
23:28 sri it's one of the most popular features in other job queues
23:30 circ-user-Sar4c yes
23:31 circ-user-Sar4c @bpmedley_
23:31 jberger circ-user-Sar4c: start the loop to send then stop it on the drain callback
23:32 bpmedley_ circ-user-Sar4c : Sorry, I missed your gist.  Lots of stuff happening there.  What is failing currently?
23:33 circ-user-Sar4c The messages/strings I was sending (or so I thought) using ->send were not reaching the server.
23:33 circ-user-Sar4c sri tells me it is because of the for loop that the event loop is never getting a chance to gain control and actually send the messages
23:35 jberger Yes, start the one then stop it. Loop
23:36 circ-user-Sar4c @jberger, I am still trying to think... how do I stop a loop (sorry if this sounds too silly, but I must not be thinking straight at the moment)
23:37 jberger Mojo::IOLoop-> stop
23:37 circ-user-Sar4c Use a while instead and keep polling for a global variable to be set/reset by drain?
23:38 dvinciguerra joined #mojo
23:39 sri don't take me too serious, those github issues earlier burned me out pretty bad
23:39 bpmedley_ jberger : Why not use delay steps?
23:41 circ-user-Sar4c @jberger Like this? https://gist.github.com/anonymous/e920a7f9dcedc8f50cfb
23:42 jberger circ-user-Sar4c: looks pretty complicated
23:43 circ-user-Sar4c I just changed the drain event handle and added a Mojo::IOLoop->start unless Mojo::IOLoop->is_running; in the for loop. (Everything else is the same).
23:44 circ-user-Sar4c I can just paste the drain event and the for loop, if it helps.
23:46 jberger I'm working on an example
23:49 circ-user-Sar4c Okay. Thank you very much. (just shrunk it to a minimum at: https://gist.github.com/anonymous/ab02a2df3f770543bac5 should you want to check it).
23:50 sri allright, no auto rety in minion 3.0, i'll release soon
23:50 sri s/rety/retry/
23:54 jberger circ-user-Sar4c: http://pastie.org/10517110
23:55 jberger that's the simplest I can think of
23:55 jberger of course that closes the connection each time
23:56 jberger this was my test server: http://pastie.org/10517114
23:56 circ-user-Sar4c But I don't want it to close the connection each time (kind of defeats the purpose Im using a websocket in the first place)

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