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

IRC log for #mojo, 2018-02-12

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

All times shown according to UTC.

Time Nick Message
00:55 marty joined #mojo
01:06 nefarious joined #mojo
01:06 nefarious batman: are you about?
01:47 aborazmeh joined #mojo
02:06 nefarious joined #mojo
03:14 ghenry joined #mojo
05:04 dboehmer_ joined #mojo
06:13 nefarious joined #mojo
06:13 nefarious joined #mojo
06:27 berov joined #mojo
06:53 inokenty-w joined #mojo
07:22 Vandal joined #mojo
08:01 nefarious joined #mojo
08:01 nefarious joined #mojo
08:02 nefarious joined #mojo
08:02 nefarious joined #mojo
08:03 nefarious joined #mojo
08:05 berov1 joined #mojo
08:26 AndrewIsh joined #mojo
08:27 morton joined #mojo
08:35 trone joined #mojo
08:42 polettix joined #mojo
08:55 marcus pink_mist++
09:02 Edward joined #mojo
09:28 berov joined #mojo
10:01 berov joined #mojo
12:04 berov1 joined #mojo
13:04 sri so, no volunteers yet for changing the minion admin colors? :/
13:17 Ricaz Using morbo, my application runs fine. With hypnotoad, I get a 502 proxy error saying "Error reading from remote server". I've tried setting the 'proxy' setting to 1 to no avail. Any ideas?
13:33 nefarious joined #mojo
13:34 batman nefarious: i'm here
13:42 Ricaz apparently my app *only* works with morbo. it gives me proxy errors when I run it any other way :s
13:44 sri Ricaz: what does the application log say?
13:55 nefarious joined #mojo
13:58 tcohen joined #mojo
13:58 nefarious joined #mojo
14:06 phillipadsmith joined #mojo
14:13 Ricaz sri: AH01102: error reading status line from remote server localhost:3000
14:13 Ricaz sri: AH00898: Error reading from remote server returned by /skywalker/login
14:13 sri Ricaz: that's not the application log
14:13 sri proxy log is useless
14:13 Ricaz that's apache's log, which is where it fails
14:14 Ricaz the application outputs nothing
14:14 Ricaz if I just run it like $ morbo script/myscript, everything is fine
14:14 sri there is clearly a lot of information missing here
14:14 Ricaz but if I run $ script/myscript daemon -l https://\*:3000 -p, it doesn't
14:16 Ricaz sri, I'm sorry, I made a silly mistake..
14:17 Ricaz the ProxyPass in Apache was pointing at https://localhost:3000, instead of http
14:17 Ricaz I mean.. the other way around :D application was listening for https, proxy was set to http
14:17 gizmomathboy joined #mojo
14:22 Ricaz Can I set the listening port for the built-in daemon in config rather than an argument?
14:28 ChmEarl joined #mojo
14:40 Pyritic joined #mojo
14:47 pirateFinn joined #mojo
15:02 gregf_ joined #mojo
15:08 gryphon joined #mojo
15:13 Pyritic joined #mojo
15:31 Ricaz Quick way to append all params from request to response?
15:41 sh14 joined #mojo
15:49 gryphon joined #mojo
16:12 jkramer joined #mojo
16:12 jkramer Moin
16:13 jkramer I just noticed that Mojo::IOLoop::Delay::data is deprecated for a while. What was the intention and more important, what's the replacement? :)
16:15 jberger jkramer: the replacement is just to close over a hashref
16:16 jberger originally data was supposed to help prevent reference cycles, it turned out it wasn't necessary
16:17 jkramer Ok so I just make my own $data before starting the delay stuff? Is that safe? :)
16:17 jberger yeah
16:17 jberger or, equally safe as having a data bucket on the object
16:17 jkramer Ok thanks :)
16:18 jkramer Ha yeah I guess, just need to make sure it's limited to the handlers scope
16:23 sri we could use some notes on delays here https://github.com/kraih/mojo/wiki/Upgrading
16:25 jkramer Eeek, ->remaining is also gone?
16:26 mohawk jkramer, are you able to change your code to use promises?
16:27 jkramer In the long term I guess, would be rather complicated
16:31 jkramer Arrgh this will be a cumbersome task. :( I guess I'll better not update Mojo for a while now :D
16:48 jkramer I think promises won't do the job. I need to dynamically add more steps to the delay. 'til now I just did `unshift @{$delay->remaining}, ...`, that won't work without ->remaining.
16:48 jkramer Unless I use delay->{steps} directly but urrgh
16:58 mohawk jkramer, i'm a self-confessed fan of promises. are you able to show a snippet of code where you have to add steps, that you couldn't instead do with a "->then"?
16:59 Grinnz jkramer: adding steps dynamically was never really a feature of delays, and is something promises do fine with
17:02 jkramer mohawk: Well basically I need to fetch an unknown number of pages, from another service, so what I do is fetch one in a step, check the results in the next step, and if it's not the last page I repeat that by unshifting the first to steps into ->remaining
17:03 jkramer That's one example, I need to do this with other stuff as well but it's always the same principle. Do X, check result in next step, repeat if necessary
17:03 zivester joined #mojo
17:05 jkramer The whole thing is fairly complex with 17 steps in total, of which 4 pairs of steps potentially need to be repeated
17:16 jkramer Can we just undeprecate ->remaining? It would make my life so much easier and it really is a useful thing to have ;)
17:16 mohawk jkramer, isn't that the perfect thing to check for in a ->then?
17:18 mohawk ->then(sub { process($_[0]); if (need_more($_[0])) { return fetch_more($blah) } });
17:18 mohawk it's entirely possible i'm missing something vital
17:19 epiphero jkramer: I'm in pretty much the same boat.  I've been going through converting everything to promises, and it does take a while, but so far I haven't hit any real roadblocks.
17:19 jkramer mohawk: How do you append another ->then from inside the promise's callback?
17:21 jkramer The fetch_more() part is supposed to also run in its own step ansynchronously. I don't see how I can do that dynamically
17:21 jkramer epiphero: How did you handle this case?
17:21 epiphero Returning a promise from the then is pretty much the same as unshifting onto remaining.
17:22 jkramer Oh ok I didn't know you can return a promise and it gets added to the queue
17:22 jkramer I'll try but I think the code might get real messy :)
17:22 epiphero Not so much added, as the result is the resolution of the returned promise, so that promise has to finish, then you continue.
17:23 Seth joined #mojo
17:24 epiphero FWIW, I'm working on a Mojo::Promise::Role::More that has a few utility things like and `any`, `some`, and `map`
17:25 maschine_ joined #mojo
17:33 joule joined #mojo
17:38 mohawk jkramer, the "if" block would return the new promise with a "then" attached to it
17:38 mohawk epiphero, you could include a modified "all" and "race" that can take non-promises, which would be super
17:40 mohawk "allnp", "racenp"
17:44 anony joined #mojo
17:45 joule joined #mojo
17:49 Seth joined #mojo
17:50 jkramer It seems to work but I find it confusing and don't fully understand what's happening :) http://dpaste.com/380VXEB.txt
17:55 jkramer This is much better, you should add that :) http://dpaste.com/2ASK7CT.txt
18:06 Grinnz jkramer: i think you need to read more on promises, this doesn't really make any sense
18:06 Grinnz promises work by creating a new promise via ->then
18:06 Grinnz you shouldn't be keeping track of steps
18:06 Grinnz just append a callback when needed
18:09 trone joined #mojo
18:23 gryphon joined #mojo
18:29 [1]mohawk joined #mojo
18:49 jamesaxl joined #mojo
18:58 berov joined #mojo
19:01 epiphero mohawk: something like sub allnp { my $class = blessed(shift); $class->all(map { $class->new->resolve($_) } @_) } ?
19:05 jamesaxl joined #mojo
19:05 epiphero Although I suppose it shouldn't be a method...and could be faster if it didn't create a bunch of promises just to resolve them right away. :)
19:06 Pyritic joined #mojo
19:12 bwf joined #mojo
19:32 nefarious joined #mojo
19:41 nefarious joined #mojo
20:20 mohawk epiphero, what i have in mind is not that, but what i had in my PR - #1177 i think?
20:20 mohawk so it can *handle* non-promises by immediately storing them, without having to wastefully create one to immediately resolve
20:21 mohawk and i think it would be clearest as a class method, since it's a version of "all" which is also one
20:21 mohawk Grinnz, well said
20:24 mohawk jkramer, as Grinnz said: that is based on a misunderstanding of the point of promises
20:52 nefarious joined #mojo
21:01 ghenry joined #mojo
21:17 polettix joined #mojo
21:26 Seth joined #mojo
22:07 jabberwok joined #mojo
23:19 Seth joined #mojo

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