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

IRC log for #mojo, 2017-01-23

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

All times shown according to UTC.

Time Nick Message
00:28 heshg joined #mojo
00:31 PryMar56 joined #mojo
01:15 disputin joined #mojo
01:16 aborazmeh joined #mojo
01:55 kaare joined #mojo
02:00 ccakes joined #mojo
02:24 kaare joined #mojo
02:26 bobkare joined #mojo
03:20 frogmella joined #mojo
03:20 stryx` joined #mojo
03:21 kiwiroy joined #mojo
03:48 noganex_ joined #mojo
04:09 marty_ joined #mojo
04:17 firnsy joined #mojo
04:18 zach do I read correctly that mojo::pg doesn't prepare statements by default?
04:33 Grinnz sure it does
04:34 lluad joined #mojo
04:53 zach I guess I misread
04:53 prajith joined #mojo
05:04 dboehmer joined #mojo
05:18 inokenty-w joined #mojo
06:40 frogaincia joined #mojo
06:58 dod joined #mojo
07:07 kiwiroy joined #mojo
07:40 Vandal joined #mojo
07:58 janl joined #mojo
08:03 salva joined #mojo
08:19 dod joined #mojo
08:20 AndrewIsh joined #mojo
08:24 dod joined #mojo
08:38 rshadow joined #mojo
08:46 rshadow joined #mojo
08:52 trone joined #mojo
09:05 foursixnine joined #mojo
09:37 tyldis joined #mojo
09:37 sugar joined #mojo
09:57 Petru joined #mojo
10:05 kwa zach: Were you referring to disabling pg_server_prepare? https://github.com/kraih/mojo-pg/blob/6fc280f79bab3b0a10be824f1658cad895320c54/Changes#L191-L193
10:31 sri batman: the path function is never actually imported here https://metacpan.org/source/JHTHORSEN/Mojolicious-Plugin-AssetPack-1.37/lib/Mojolicious/Plugin/AssetPack/Pipe/Sass.pm#L148
10:32 batman thanks! Wonder why the test is ok :/
10:33 sri my first thought as well
10:33 sri very odd
10:35 batman oh. i've already installed sass globally :(
10:36 stephan48 https://metacpan.org/source/JHTHORSEN/Mojolicious-Plugin-AssetPack-1.37/lib/Mojolicious/Plugin/AssetPack/Pipe.pm#L3
10:36 stephan48 its imported in the parent module
10:37 sri stephan48: doesn't mean anything for functions
10:38 batman fixed now. i'll make a new release a bit later.
10:38 stephan48 sri: it does not?
10:40 batman stephan48: only method calls use @ISA
10:53 stephan48 ah thanks for clearning that misunderstanding!
10:54 stephan48 makes quite a bit of sense actually
12:07 dod joined #mojo
12:15 tchaves joined #mojo
12:27 dod joined #mojo
13:05 sugar joined #mojo
13:11 elrey joined #mojo
13:13 dod joined #mojo
13:15 cpan_mojo Mojolicious-Plugin-AssetPack-1.38 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-1.38
13:17 stryx` joined #mojo
13:25 lluad joined #mojo
13:27 elrey Hey. I'm running mojo with apache and i'm seeing [debug] logs in my error.log file, how can i disable that?
13:28 elrey I have mode('production') in my startup function but i can still see them
13:29 foursixnine joined #mojo
13:31 rshadow joined #mojo
13:33 jberger elrey which application server are you using?
13:37 rshadow joined #mojo
13:37 jberger Anyway I can't remember off hand but seeing the mode in the application might be too late
13:38 marty joined #mojo
13:38 jberger You can always use the environment variables MOJO_MODE and MOJO_LOG_LEVEL to establish those
13:48 Petru joined #mojo
13:54 elrey im using mod_cgi module with cgi-script handler
13:57 rshadow joined #mojo
13:58 elrey ok i found a solution. just create new instance of a logger with the desired log level and set it as default by $self->log($log);
14:07 nic using the env vars would be fewer cpu cycles
14:10 Petru joined #mojo
14:12 gryphon joined #mojo
14:14 heshg left #mojo
14:14 sugar joined #mojo
14:18 Petru joined #mojo
14:21 elrey yep, I changed it to env var. thanks
14:22 charsbar joined #mojo
14:41 Pyritic joined #mojo
14:46 bwf joined #mojo
14:50 Petru joined #mojo
14:59 dikim joined #mojo
15:24 kiwiroy joined #mojo
15:34 janl left #mojo
15:37 Petru joined #mojo
15:45 sugar joined #mojo
15:49 marty_ joined #mojo
15:50 coolo sri: https://twitter.com/shxrlocked/status/822887186345459712 - isn't that your sign? :)
15:52 sri no, mine is totally different https://i.stack.imgur.com/jiFfM.jpg
15:52 purl okay, sri.
15:55 sh14 joined #mojo
16:06 bwf joined #mojo
16:25 asarch joined #mojo
16:28 disputin joined #mojo
16:58 Petru joined #mojo
17:10 kiwiroy joined #mojo
17:28 sri so, what's the consensus on lilyhammer, good show?
17:34 vicash sri: lilyhammer is boring
17:49 disputin joined #mojo
18:03 sugar joined #mojo
18:03 genio I watched the first season I think.  It was kind of boring, but lightly humorous
18:06 PryMar56 joined #mojo
18:10 kiwiroy joined #mojo
18:12 Petru joined #mojo
18:14 sri i need something new to watch
18:16 sri so, i guess this is not the case? https://github.com/kraih/mojo/issues/1042#issuecomment-274335795
18:16 vicash sri: maybe The Night Manager...
18:16 sri already watched it
18:16 sri wasn't that great
18:17 vicash agree, it was predictable
18:17 * Grinnz has been watching Critical Role, 78 3-5 hour episodes is quite the time sink
18:18 * vicash has been watching The Americans... even though set it in the 80s USA, seems prescient for the new order
18:18 Grinnz the dungeon master is the voice of mccree, so whenever i watch it i want to play overwatch and vice versa :P
18:21 Grinnz i just tried vscode in fedora... i don't know if it's because of virtualbox, but it's completely unusable
18:21 Grinnz the whole window is just a graphical glitch
18:21 Grinnz :/
18:22 Grinnz virtualbox support for graphics has been getting worse
18:23 vicash Grinnz: similar performance experience here with Virtualbox.. i am wondering if i should migrate my VMs to Vagrant/kvm directly instead of using VBoxManage
18:23 Grinnz both of my machines are windows hosts, so i'm not sure if there's a better option
18:24 pink_mist vmware?
18:24 purl vmware is probably pay to use software. :-/
18:24 Grinnz tried that once, couldnt figure out the interface or lack thereof
18:24 pink_mist I never had any problem figuring out vmware tbh
18:25 Grinnz does it do shared host folders and bidirectional copy-paste?
18:25 vicash pink_mist: VMWare player is limited functionality... has gotten worse over the years as they really want you to purchase...
18:26 pink_mist Grinnz: I never really used those bits myself; I rather use samba/cifs for sharing data ... so I'm not quite sure
18:26 pink_mist I think it should
18:27 Grinnz i would be very glad to never touch samba again
18:27 sri i switched to vmware fusion because virtualbox was too slow
18:28 sri hmm, the americans is on netflix
18:29 sri have also not watched better call saul yet
19:02 Seth joined #mojo
19:03 bwf joined #mojo
19:09 kiwiroy joined #mojo
19:17 user_685 joined #mojo
19:18 user_685 I have a question about out of scope varaibles
19:18 user_685 my $abc = 123;
19:18 user_685 $self->ua->post('http://....' => sub { print $abc; });
19:18 user_685 this is non-blocking-style with an own callback
19:18 Grinnz so, i just tried an installation of fedora in vmware player, and immediately everything works out of the box because of open-vm-tools
19:19 Grinnz if shared folders work i'm probably switching :P
19:19 user_685 will it cause problems to access $abc ? It's working, but i dont understand why?
19:19 user_685 shouldn't it be out of scope?
19:20 pink_mist user_685: the code you wrote had $abc in scope, so it'll still be referenced inside that sub, and so it will work like it should
19:20 rshadow joined #mojo
19:20 pink_mist user_685: it's called a closure
19:20 Grinnz it keeps $abc around as long as that subref is around
19:21 Grinnz but scoped to where it was originally
19:21 Grinnz it's a little weird but mostly intuitive
19:21 user_685 I see
19:21 user_685 sub test { my $abc = 123; $ua->post('http://...' => sub { print $abc }); }
19:21 user_685 so this will work always
19:22 Grinnz yes
19:23 Grinnz closures are mostly why specifying arguments to anonymous subs is usually unnecessary
19:23 Grinnz the exception is to avoid ref cycles, since the subref is essentially maintaing a reference to those variables
19:24 Grinnz whereas if it's passed in on call, it doesn't
19:25 user_685 ok, when re-calling it while it's still not out of scope the new call will get it's own abc allocated to another memory area, right?
19:25 Grinnz no, same $abc
19:25 pink_mist Grinnz: what????
19:25 pink_mist Grinnz: I think you misunderstood him
19:26 pink_mist user_685: you mean when you call test() right?
19:26 Grinnz { my $foo; sub foo { $foo++ } } say foo() for 1..10
19:26 pink_mist user_685: because if that's what you mean, you're correct
19:26 user_685 yes, let's say I increase abc by 1
19:26 Grinnz oh, if you're re-declaring the variable and subref yes that will be a new variable and subref
19:26 user_685 the call to test shouldn't start at abc+1
19:26 user_685 new*
19:27 user_685 Grinnz: actually I meant when i recall test()
19:28 user_685 while $abc from another call is not out of scope; new calls to test() will recieve new $abc at it's own memory location?
19:28 pink_mist 20:25 <user_685> ok, when re-calling it while it's still not out of scope the new call will get it's own abc allocated to another memory area, right? <-- this is true if you mean test(). if you mean the anonymous subref inside test, it is not true.
19:28 Grinnz yes, you're declaring a new lexical $abc
19:28 Grinnz that's unrelated to the previous one
19:29 user_685 pink_mist yeah, i meant test()
19:29 Grinnz same as if you call a sub foo { my $foo } a bunch of times, each $foo is unrelated
19:49 Petru joined #mojo
19:51 Ryoga joined #mojo
19:53 Ryoga Hello :)
19:58 mishanti1 Hi there
20:02 Ryoga I'm brasilian and starting perl
20:06 Ryoga What's new?
20:06 purl new is, like, for creation, but that's not the only place to hook if you want instantiation
20:08 Ryoga I'm now perl and make any scripts in perl
20:08 Ryoga Now I learning mojo
20:08 jberger Ryoga don't worry about purl, she's a bot
20:09 jberger purl: botsnack
20:09 purl thanks jberger :)
20:09 Ryoga Ah OK :)
20:10 jberger sri: re 1042, IIUC the reason that Mojo::Util::spurt didn't take @lines was because it made the functional api awkward
20:10 jberger spurt(qw/line line line/ => $path);
20:11 jberger but maybe it makes more sense with an OO api that doesn't end in a path?
20:15 DavidSouza joined #mojo
20:22 htoetl joined #mojo
20:30 htoetl hi, i'm new to mojo, and last 8 hours i've been trying figure stuff with trying websockets. the issue is that i've added Mojo::IOLoop::Signal that catches the HUP (used to be quit), and then sends "bye" and does $c->finish. but the thing is that ->finish doesn't do anything and ->send doesn't send stuff. in a general callbacks ->send works as expected. i'm going nuts already..
20:31 htoetl how to properly catch signal, send data and close a websocket?
20:32 DavidSouza joined #mojo
20:35 Ryoga joined #mojo
20:37 rshadow joined #mojo
20:39 jberger htoetl which server are you using?
20:40 htoetl Mojo::Server::Daemon
20:40 htoetl Mojo::IOLoop
20:40 purl Mojo::IOLoop is always full of suprises...
20:40 jberger Ok so daemon, that's good
20:40 htoetl well, i've lost 8 hours already
20:40 jberger We aren't dealing with preforking
20:40 htoetl i don't think it's good )
20:41 htoetl why is it stopping sending data?
20:42 jberger Are you sure you've actually trapped the signal?
20:42 htoetl yes
20:42 jberger I don't know anything about that module
20:42 htoetl well, the signal is trapped
20:42 htoetl i get into that sub
20:42 htoetl i actually sometimes managed to make data be sent
20:43 htoetl but only when i cause some errors in the ev
20:43 htoetl like calling unexisting method
20:43 htoetl is there some other way to react to a signal then?
20:44 jberger I would probably just trap it myself with %SIG
20:44 htoetl i tried, but it didn't work
20:44 htoetl don't remember why
20:44 kiwiroy joined #mojo
20:45 jberger Give me a sec, I'll write an example once I'm back at my desk
20:46 jberger But i suspect your problem has to do with ev signal traps
20:46 jberger It sounds like it basically is refiring the signal
20:46 htoetl it seemed to be a case when i was trying sigtrap
20:47 htoetl but with this module it doesn't look like that, but i might be wrong
20:47 htoetl is there some way to replace ioloop?
20:47 htoetl with something else?
20:50 geheimnis` joined #mojo
20:53 jberger htoetl: https://gist.github.com/a9aa430ce0a069f5f8b10b8a65a0cc97
20:53 jberger and Mojo::IOLoop is basically a requirement for mojo servers, but it can use one of several reactor backends if you are looking to interop with something else
20:54 jberger anyway, the thing with that example is that it will look kinda funny because the loop is only being used to check that one timer, so the loop's intermediate timeout is really long
20:54 jberger probably I should have used a shorter recurring timer for the demo
20:55 jberger 0.5 and you wouldn't notice
20:55 jberger anyway, when it is part of a server you won't notice eitehr
20:55 jberger either
20:56 jberger now in your websocket controller, let $bus->on(HUP => sub { ... }) do your write and close
20:57 htoetl well, the signal is working
20:57 htoetl i get into the signal's cb
20:57 htoetl it's not the issue
20:57 htoetl the issue is why ->send  and ->finish do not work there..
20:58 jberger I can't answer that until i'd see your code
20:58 kes joined #mojo
20:59 mishanti1 Dang, YTCracker has some pretty chill coder-tunes. The song "Golden Girl" is pretty cute.
21:00 mishanti1 Also Dale Chase has some pretty entertaining tunes. Just thought I'd share if anyone here want something _completely_ different from what they usually listen to.
21:01 jberger htoetl wait, you said that sometimes a little data gets through and then it closes the websocket early?
21:01 htoetl in case if i cause a ev error
21:02 jberger let me guess, you wrote something like $c->send($data); $c->finish;
21:02 jberger send is non-blocking
21:02 jberger you should do $c->send($data => sub { $c->finish });
21:03 jberger so that it waits until the data is written before closing
21:03 kiwiroy joined #mojo
21:03 htoetl EV: error in callback (ignoring): Can't locate object method "resume" via package "Mojolicious::Controller"
21:04 htoetl in this case it does send
21:04 htoetl regarding your suggestion
21:04 htoetl of course i tried
21:04 htoetl $u{$id}{'c'}->send({json=>{a=>'closed',reason=>123}})->on(drain=>sub {print STDERR "drained:",time,"\n";});
21:05 htoetl but drained never happens
21:06 jberger try it with the form I gave
21:06 htoetl and if i use $u{$id}{'c'}->tx->closed();
21:06 jberger no, don't call closed() yourself
21:06 htoetl then the socket is closed
21:06 htoetl but no data is sent
21:06 jberger that's low-level api
21:07 jberger you want $c->finish or $tx->fininsh
21:07 jberger $tx->finish
21:07 htoetl these i tried, but no use
21:08 jberger htoetl: I can't help any further without seeing any code
21:08 htoetl too bad i dont understand the architecture of this thing, so all i can do is guessing and doing random stuff
21:08 htoetl yes, i know
21:08 htoetl i need to clean the code to make a test case
21:09 jberger the %u datastructure you show above already gets me worried though
21:09 jberger that kind of a thing gets complex faster than you'd think
21:14 jberger heh, ok I think I know your problem
21:15 jberger $c->on() is a wrapper for transaction events
21:16 jberger the fact that it is trying to call resume on the controller (which doesn't implement resume) is being used where a transaction is expected
21:16 jberger and I can't know where that is without seeing the code
21:17 jberger but I'm going to guess that someplace, you are replacing a transaction with a controller and you don't notice it because much of the time that works
21:17 jberger since the controller passes through several methods to the transactions
21:18 jberger actually, it probably even is the drain subscription
21:19 jberger I highly recommend the ->send($data => sub { ... }) form
21:20 htoetl maybe i'm just taking it wrong
21:21 htoetl i take it from websocket '/ws' => sub { my $c=shift;
21:22 htoetl then $c goes  to $u{$id}{'c'}=$c
21:22 htoetl and then it's just used
21:28 Petru joined #mojo
21:30 Pyritic joined #mojo
21:37 jberger htoetl: did you try the callback form rather than the subscription form?
21:37 htoetl for what?
21:37 purl for fun.
21:37 htoetl for drain?
21:39 lgug3h3gh joined #mojo
21:39 lgug3h3gh left #mojo
21:41 jberger I have to work, sorry
21:44 htoetl jberger: the test case, if you will have time of course :)  http://pastebin.com/PMM4Wrnf
21:45 htoetl maybe indeed i'm taking a wrong handler
21:45 htoetl and it should be something else
21:53 jberger why are you stopping the daemon?
21:53 jberger and also, why are you using your own daemon?
21:54 htoetl well, it can be commented out
21:54 htoetl just to stop receiving new connections
21:54 jberger also, select?
21:54 htoetl just for logging
21:56 Grinnz shared folders mostly work, vscode works. looks like i'm switching to vmware
21:57 jberger I have no idea what stopping the daemon mid-send is going to do but I'm going to guess that it could interrupt data being sent
21:57 htoetl as i said, removing the line doesnt change anything
21:58 jberger and you still haven't tried changing send(...)->on(drain => sub { ... } ) to a callback
21:59 htoetl the drain is just for seeing if it's sent. but it's not as i can see on client as well.
21:59 htoetl i just removed the drain
22:00 jberger wait wait wait
22:00 jberger you ARE just calling $c->send(); $c->finish(); like I asked all the way at the top of this?
22:01 jberger sorry, I should have looked more carefully
22:01 jberger https://irclog.perlgeek.de/mojo/2017-01-23#i_13976264
22:01 jberger I'm ....
22:01 htoetl i don't know the proper syntax
22:02 htoetl $c->send({json=>{a=>'closed',reason=>123}} => sub { $c->finish });
22:02 htoetl like this?
22:02 purl rumour has it like this is ok
22:02 jberger yes, that will then wait until it has finished writing before closing the connection
22:02 jberger as I said at the time
22:02 htoetl the thing is not that it doesn't wait
22:02 htoetl the thing is that it doesn't happen :)
22:02 htoetl but i will change it
22:03 htoetl hold on
22:03 jberger zomg, because you then exit()?!
22:03 htoetl no
22:03 htoetl exit happens after a loop checking
22:03 jberger this is nonblocking code
22:03 jberger all that happened is that you scheduled things to start
22:04 jberger you have to then wait for them to finish before exitting
22:05 htoetl is this ok? $u{$id}{'c'}->send({json=>{a=>'closed',reason=>123}}=>sub { $u{$id}{'c'}->finish() });
22:05 htoetl i do wait for them
22:05 htoetl take a look at the loop
22:06 jberger htoetl: I don't want to sound smug here, but can I please just insist here that I know what I'm talking about
22:06 htoetl i didn't argue with that..
22:06 htoetl i'm certainly have no clue about mojo or what's happening there
22:07 jberger non-blocking code happens in the order of scheduled events not in order that the code reads
22:07 sri Mojo::IOLoop::Signal looks pretty sketchy
22:07 htoetl but that loop keeps printing "Still $count open.." till i kill the process..
22:07 bpmedley joined #mojo
22:07 sri look at that! https://metacpan.org/source/SKAJI/Mojo-IOLoop-Signal-0.001/lib/Mojo/IOLoop/Signal.pm#L75
22:07 htoetl which makes me think it waits :)
22:07 jberger sri: and it leans on EV's signal watchers which are also pretty sketchy
22:08 sri it uses a pipe!
22:08 jberger I .... waht?
22:08 jberger htoetl sure, but it is doing that before it writes
22:08 jberger which is why you don't see any data
22:08 sri it uses a pipe and an io watcher instead of next_tick :)
22:09 sri although
22:09 sri i guess it makes sense
22:09 sri the goal seems to be to wake the event loop up as soon as possible
22:09 sri and it blocks waiting for io
22:10 jberger so its because the ioloop handles io first and then timers?
22:10 jberger (which I assume is an implementation detail)
22:10 sri no, it's because you can escape poll()
22:10 sri poll() may be blocking for a few seconds if no timers are scheduled
22:11 sri the pipe can wake it up immediately
22:11 sri pretty clever
22:11 jberger ah, that's just what I saw when I made my first example :p
22:11 sri https://github.com/kraih/mojo/blob/master/lib/Mojo/Reactor/Poll.pm#L53
22:12 jberger https://irclog.perlgeek.de/mojo/2017-01-23#i_13976202
22:12 htoetl as i understand my way out is to rewrite the thing without mojo? :)
22:13 jberger htoetl: I don't know what to tell you
22:13 htoetl well, i'm totally clueless
22:13 htoetl so i dont even know what to ask
22:13 htoetl i just didn't understand what you say, i guess
22:14 htoetl or  you mean my loop blocks sending?
22:15 jberger sorry, I'm just frustrated because I've spent a lot of time working with you on this (rather than doing my own work) and it turns out that you need lots more help or else you are going to just rewrite some other way
22:15 jberger nonblocking code has a bit of a learning curve
22:15 sri htoetl: what are you trying to achieve?
22:16 htoetl sri: i just needed to make a simple websocket server, that upon receiving a signal would send to all existing connections
22:16 htoetl "bye", then would finish
22:16 htoetl opened sockets
22:16 htoetl and quit
22:16 Grinnz https://metacpan.org/source/SRI/Mojolicious-7.21/examples/chat.pl does this
22:16 sri well, then don't call exit() from your signal handler
22:17 Grinnz oh, "receiving a signal", sorry
22:17 htoetl my exit never happens
22:17 sri the chat app is a good example though
22:17 sri htoetl: there, then that's your problem
22:17 jberger htoetl: you need to orchestrate the finish events, probably with Mojo::IOLoop::Delay
22:17 jberger so that when they all complete it then calls exit
22:17 sri the event loop can only do stuff outside your callbacks
22:18 Grinnz you should never exit, once all connections are closed the event loop will stop and then app->start will return
22:18 Grinnz should never need to exit*
22:18 sri jberger: no, he just does a while (1) {} forever or so
22:18 htoetl well, i asked if that's my problem :)
22:18 htoetl if the send is delayed and while that loop executes nothing else can happen
22:18 sri if your event handler doesn't return that's a problem
22:19 jberger htoetl: I would encourage you not to instantiate your own daemon but to write this as a more proper mojo app
22:19 Grinnz nonblocking code is cooperative, each code block runs in order not simultaneously
22:19 htoetl well, if i would KNOW how to write proper mojo apps, maybe i would do that )
22:19 Grinnz the example i linked above is a start
22:19 jberger htoetl: it is polite to learn the basics before asking
22:20 sri htoetl: https://metacpan.org/source/SRI/Mojolicious-7.21/examples/chat.pl
22:20 htoetl i don't get why you send that example :)
22:20 jberger htoetl: http://mojolicious.org/perldoc#TUTORIAL
22:20 jberger and that's as far as I can continue on this
22:20 htoetl jberger: thanks, i did read that many times :)
22:20 jberger I really need to get back to work
22:21 htoetl jberger: please do not let me to distract you :)
22:21 htoetl just ignore :)
22:21 Grinnz htoetl: that is a complete websocket server, where every received message sends a message on every open websocket
22:21 Grinnz htoetl: you can easily extend it to add the signal feature you want
22:21 htoetl i do have already a working websockets server , Grinnz
22:21 Grinnz yes, but it's much more complicated than this, so it's harder to help you with
22:22 htoetl my issue was with shutdowning it properly
22:22 htoetl not with the server itself
22:22 htoetl but in any case
22:22 htoetl now my goal will be to figure out how to properly catch when all connections are closed
22:22 htoetl so i've resolved my issue
22:22 htoetl thanks :)
22:23 htoetl 9 hours and i'm done ))))
22:31 pink_mist just 1 hour after you joined ... now if you had only done that 9 hours ago :P
22:31 htoetl when i joined i said i'm 8 hours on this )
22:31 htoetl now i will spend 8 more to figure out how to call a callback when i need it )
22:32 pink_mist exactly, that's what I said
22:32 pink_mist it was 9 hours now, 1 hour ago it was 8 hours
22:32 htoetl i think i should go eat breakfast
22:32 htoetl and to sleep
22:41 htoetl aha
22:42 htoetl figured to replace loop with a$daemon->ioloop->recurring(1 => sub {
22:42 htoetl makes sense, after sri explained about the model it works in :)
22:42 htoetl i didn't think about that, cos i always used to use threads..
22:43 htoetl jberger: that would not take so much time if you would just replace that line in my code.. ;-)
22:43 htoetl thanks guys
22:43 Grinnz htoetl: it's better that you understood why, anyway
22:45 jberger for the record, that isn't how I would fix the problem
22:45 jberger as I said before, I would coordinate finish events with a delay
22:47 Grinnz yes, polling is far from the best solution
22:47 htoetl i agree
22:47 htoetl but it's 4.47 am
22:47 htoetl and after rereadin the doc about delays twice
22:47 htoetl i've not understood anything at all there
22:48 htoetl so i suppose making it work will suffice to me )
22:48 Grinnz they're hard to break into, jberger had some blog posts that helped me
22:48 jberger sure, 4:47am is a bad time to learn complex coordination behavior
22:49 jberger I'm glad you got something working
22:49 jberger when you get some rest I encourage you to continue learning about nonblocking patterns and theory
22:49 htoetl lol
22:51 htoetl the thing is to figure out how to write that thing
22:51 htoetl not to figure out what it does ))
22:51 htoetl i'm bad at understanding other people's solutions
22:52 jberger I disagree, it is important to understand how these things work
22:52 htoetl i didn't say it's not important
22:52 htoetl i say, that it's not the problem )
22:53 htoetl Grinnz: and thankks, i did use the stop instead of exit )
23:38 sugar joined #mojo

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