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

IRC log for #mojo, 2017-09-12

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

All times shown according to UTC.

Time Nick Message
01:23 tchaves joined #mojo
01:37 kavuria joined #mojo
01:43 cornelius joined #mojo
01:53 kaare joined #mojo
01:53 cornelius Is there an easier way to route variable length path parameter URL? I can have URLs as /foo/:foo1/:foo2/../:fooN and I don't know how many path parameters the URL may have.  The only thing I know is the beginning /foo.  Is there a way to route all /foo requests to a single place?
01:55 ilbot2 joined #mojo
01:55 Topic for #mojo is now 🍩 nom nom | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
02:12 noganex_ joined #mojo
02:57 tomred joined #mojo
04:04 dboehmer joined #mojo
05:23 batman arcanez: Thanks! Hope you're learning good things and not bad, hehe
05:39 dod joined #mojo
05:42 inokenty-w joined #mojo
05:46 dod joined #mojo
06:37 dod joined #mojo
06:41 n16gel joined #mojo
07:09 trone joined #mojo
07:16 Vandal joined #mojo
07:40 petru joined #mojo
07:41 mib_nx18k8 joined #mojo
07:46 bianca joined #mojo
07:47 Dandre joined #mojo
08:04 margeas joined #mojo
08:20 bianca joined #mojo
08:38 petru joined #mojo
08:49 rshadow joined #mojo
08:54 aborazmeh joined #mojo
08:56 dod joined #mojo
09:55 rshadow joined #mojo
10:48 Ptolemarch joined #mojo
11:41 sri oh shit
11:42 sri am i crazy or is this wrong? https://github.com/kraih/mojo/blob/master/lib/Mojo/IOLoop/TLS.pm#L12-L14
11:43 haarg from what i remember of the issue yeah that seems the wrong way around
11:43 sri mudler, foursixnine: your tests should not have passed
11:45 mudler well, ->VERSION was suggested, i was about to just do numerical comparison
11:45 sri the version check is correct
11:45 sri the true/false results are inverted
11:46 mudler sri: :P
11:46 mudler @sri>i guess we want "use constant TLS_DEFAULT => eval {IO::Socket::SSL->VERSION(1.995)} ? '' : \undef;"
11:48 good_news_everyon joined #mojo
11:48 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v5M4Q
11:48 good_news_everyon mojo/master d1d8c0d Sebastian Riedel: fix support for versions of IO::Socket::SSL older than 1.965 again
11:48 good_news_everyon left #mojo
11:48 sri mudler: but you and foursixnine said you tested it
11:48 mudler sri: true, :P actually i did not, i could not reproduce locally
11:48 mudler foursixnine: ?
11:52 foursixnine sri, I was testing it on a coworker's machine, that had leap... however for the last fix, I couldn't test it.
11:53 foursixnine which is when the version number was changed i think
12:21 bianca joined #mojo
12:24 kes joined #mojo
12:25 kes Hi. May someone give me an advice how to render table and process POST data with Mojolicious?
12:25 kes How to name fields?
12:25 kes http://joxi.ru/GrqKNGgSN6aPb2
12:27 good_news_everyon joined #mojo
12:27 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v5ME7
12:27 good_news_everyon mojo/master e74770c Sebastian Riedel: bump version
12:27 good_news_everyon left #mojo
12:27 good_news_everyon joined #mojo
12:27 good_news_everyon [mojo] kraih tagged v7.46 at e0dc4e0: https://git.io/v5ME5
12:27 good_news_everyon left #mojo
12:37 S joined #mojo
12:53 tcohen joined #mojo
13:07 bianca joined #mojo
13:22 petru joined #mojo
13:33 gizmomathboy joined #mojo
13:41 Peppard joined #mojo
13:54 kubrat left #mojo
14:24 foobargeez joined #mojo
14:25 foobargeez @jberger, thanks for pointing to https://github.com/tulios/json-viewer.  It's beautiful :)
14:26 zivester joined #mojo
14:27 marty joined #mojo
14:41 gryphon joined #mojo
14:49 marty joined #mojo
14:54 arcanez batman: well, things have gotten better for me, I used to find your code confusing :) eventually I'll delve into how things like Mojo::SNMP work (as I am/was an SNMP::Effective user)
15:06 ChmEarl joined #mojo
15:17 stryx` joined #mojo
15:19 batman oh. yeah... but that code is indeed very confusing :/
15:29 arcanez soon I don't think I'll have a need for SNMP (sadface) but I'll continue to use Mojo and associated stuff so
15:41 jberger you have a sadface on NOT needing SNMP?!
15:57 disputin joined #mojo
15:59 batman hahaha
16:07 bianca joined #mojo
17:05 rshadow joined #mojo
17:10 rickbol joined #mojo
17:11 sri interesting vscode extension if you're into debuggers https://marketplace.visualstudio.com/items?itemName=mortenhenriksen.perl-debug
17:47 disputin1 joined #mojo
18:02 arcanez jberger: SNMP is fun.
18:03 arcanez jberger: it'd be neat if vendors actually put time and effort into properly supporting it
18:20 tchaves joined #mojo
18:24 tyldis Sigh. My skills aren't letting me mix AnyEvent::FTP::Client with Mojo.
18:24 tyldis It appers to work fine, but leak sockets
18:25 tyldis Not memory, just sockets
18:28 tyldis Subprocess might be a quick fix instead, I guess
18:30 jberger sri: neat ...
18:31 jberger that's the first thing that makes me think about trying an editor other than vim
18:34 jberger tyldis: hunh ... AnyEvent::FTP::Client is plicease?
18:35 tyldis jberger: It seems so
18:38 tyldis I think it's just me not understanding at all how AnyEvent works and probably need to end the callbacks with something magical. The anectodal examples in the Mojo docs did not help me.
18:38 tyldis I'll try and condense the code to a sample
18:39 dod joined #mojo
18:44 petru joined #mojo
18:51 dod joined #mojo
19:20 bianca joined #mojo
19:26 rshadow joined #mojo
19:41 tyldis https://ssl.thorsen.pm/paste/5f3d9ccbbc71
19:42 tyldis Everything is dndy until I call ->stor
19:43 tyldis Still possibly just me not knowing what I'm doing with AnyEvent.
19:43 tyldis Tried so many permutations of what I read from the docs
19:44 tyldis lsof -p <pid> will show a growing number of sockets, one for each ->stor
19:44 tyldis Until ulimit is reached and it all burns down.
19:55 vicash tyldis: try explicitly closing the socket when you call `say "done";`
19:56 tyldis I'll have to dive into the internals. Doing $client->quit does not close the socket properly
19:56 tyldis Which is where I started
19:57 tyldis Doing just a dir listing is not a problem
19:57 tyldis Doing ->stor is
19:57 vicash tyldis: what about `$client = undef;`  ? Have Perl recover the memory on its own maybe.
19:57 tyldis vicash: Yep, tried that too. No change.
19:57 tyldis Doesn't appear to leak memoty, just the sockets
19:58 tyldis memoty
19:58 vicash tyldis: then it might be a resource leak in the native code.
19:58 tyldis Err.
19:58 tyldis I do about thousand tranfers before hitting ulimits, and memory usage is stable
19:59 tyldis vicash: Next on my list, just wanted some validation that I was not insane.
20:03 vicash tyldis: you can use `strace` to track the `open()` and `close()` system calls on each socket, and check if `close()` is being called at all. If not, then that's your problem. You can also check if every call to `->stor()` leads to a socket open. This would be better than `lsof` since that shows only open sockets. `strace` can show that a socket might be reading or waiting on something and hence isn't closed.
20:03 tyldis Ah, of course. Thanks
20:05 tyldis Yup, each ->stor also does a "connect" with a new fd
20:05 andy joined #mojo
20:06 Grinnz you could try attacking it from another angle: use SCP or SFTP instead of FTP :P
20:08 vicash tyldis: https://metacpan.org/source/PLICEASE/AnyEvent-FTP-0.16/example/fput.pl#L99 This example shows that you have to handle the object returned using the `stor()` call and call `recv` on it. Line 99-122.
20:08 tyldis True. Wht do you recommend for async sftp/scp transfers with Mojo?
20:09 vicash so the leak is in your example. just call `->recv` after the `stor()` call in the callback maybe and it might close the connection.
20:09 tyldis vicash: Aha, trying that now. Really appreciated.
20:11 Grinnz tyldis: unfortunately i'm not really familiar with ways to do them in a non-blocking manner
20:19 tyldis Grinnz: Sadly, this is my life. Slowly reolacing our internals with either AMQP, MQTT or REST. But it's a slow process and until then there are files to herd.
20:20 tyldis vicash: Line 116 is the secret sauce for the socket. Thanks :)
20:20 dod joined #mojo
20:20 * tyldis hugs vicash
20:21 tyldis s/reolacing/replacing
20:21 tyldis Too tired to type it seems.
20:40 stryx` joined #mojo
20:52 PopeFelix Say I do some asynchronous things inside of a helper method. How do I ensure that the IOLoop has run everything before I return out of the method?
20:52 * PopeFelix can work up a paste if that's too abstract
21:27 CHYC ~.
21:28 bobkare joined #mojo
21:29 Grinnz PopeFelix: thats not really how event loops work
21:30 Grinnz asynchronous things will always happen after you return
21:30 Grinnz or at least, their event-loop triggered callbacks will
21:30 Grinnz the ioloop isn't running until you return from whatever the ioloop currently called
21:30 Grinnz (the action, in a mojolicious app)
21:31 Grinnz i mean it's "running" but it's only running that action
21:32 PopeFelix OK, cool
21:33 Grinnz thats why anything you need to do after an async operation needs to be triggered by the callbacks, later delay steps, future chains, etc
21:33 * PopeFelix nods
21:34 PopeFelix Thanks for clarifying that
23:26 mtths joined #mojo
23:41 disputin joined #mojo

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