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

IRC log for #mojo, 2015-08-04

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

All times shown according to UTC.

Time Nick Message
00:00 mattastrophe joined #mojo
00:24 mattastrophe joined #mojo
00:57 Grinnz ok i finally figured out what Mojo::Base::tap is for, only problem is, the only times i'd want to use it are for objects that aren't Mojo::Base
00:58 Grinnz because pretty much all mojo methods that mutate return the object anyway
00:58 thowe joined #mojo
01:08 mattastrophe joined #mojo
01:45 mattastrophe joined #mojo
02:46 noganex joined #mojo
03:15 g112wdh joined #mojo
03:32 zivester joined #mojo
03:38 jberger Grinnz: I had a whole router pattern based on tap
03:39 jberger https://gist.github.com/jberger/c69599f61c67b6149af8
03:41 Grinnz i suppose, i just wouldn't think of doing it that way
03:42 Grinnz i was just messing with URI (because i need URI::file to parse filenames into URIs portably) and was thinking something like tap would be useful, because URI doesn't return the object on mutators
03:43 jberger Grinnz: right, I know what you mean
03:43 Grinnz but whatever; 3 lines instead of one, big deal ;P
03:43 jberger I'm just saying that that is the rare time I did use it
03:44 kaare joined #mojo
03:45 Grinnz on a related note... /me twiddles thumbs and waits for mswin32 reports to show up on http://matrix.cpantesters.org/?dist=Mojo-SQLite+0.008
03:46 Grinnz i should just install strawberry perl or something on my desktop... but i'd feel dirty afterward
03:50 Grinnz surprisingly, the tests didnt fail on mswin32 when i was blindly shoving File::Temp filenames into URI paths, i have no idea why that would even work
03:52 jberger Nice, that sounds like an interesting one
03:53 * Grinnz just wants to see what File::Temp actually outputs on mswin32, maybe should have added a diagnostic... heh
03:55 preaction if i recall correctly, i've seen unholy abominations of / and \ in the same path...
03:55 Grinnz yeah... that *might* work in mswin32
03:56 Grinnz afaik URI::file treats them the same when parsing filenames
03:57 jberger preaction: did you know that sandra uses system path tools to split/join data paths?
03:57 jberger Enjoy debugging that one some day (I did)
03:57 preaction ... what. ever-loving moron. thought of that one
03:57 jberger Another bug i reported that they choose to ignore
03:58 Grinnz what's sandra?
03:58 preaction i know i have real problems in Statocles with the difference between file paths and URLs
03:58 Grinnz yeah. i didnt even think of it at first, because here in the civilized world a URI path and a file path are interchangable
03:59 preaction sandra is a custom-built C++ object database for python objects. because jberger's former employer and my current employer suffers from a massive case of "NIH" and an even massiver case of "throw money at the problem"
03:59 Grinnz but we have these win32 barbarians around, and such...
03:59 Grinnz heh
04:00 jberger Pretty soon they won't be using operating systems that weren't inverted here
04:01 jberger Then what's after that, logic gates?
04:01 Grinnz if you invert windows, does it become open?
04:01 jberger Hehe
04:01 jberger Swipe fail, but a fun one
04:03 preaction FPGAs? Josh was saying his company bought a few FPGAs for some algo trading stuff
04:04 Grinnz whos bot is Bender? and does it do anything except op people :P
04:04 preaction perigrin maybe? i'm fairly sure perigrin has at least a key to Bender
04:05 preaction and, afaik, no, Bender just does what Bender does. builds his own chanops, with blackjack, and hookers!
04:10 elik joined #mojo
04:33 davido__ joined #mojo
04:36 davido__ joined #mojo
04:49 jberger preaction: I meant transistors, nih hardware
05:31 jzawodn joined #mojo
06:04 chhikv joined #mojo
06:47 trone joined #mojo
06:58 Dandre joined #mojo
07:15 arpadszasz joined #mojo
07:19 eseyman joined #mojo
07:19 Vandal joined #mojo
07:41 trone joined #mojo
07:47 KindOne joined #mojo
08:34 jzawodn joined #mojo
08:56 vytas` joined #mojo
09:02 mtths joined #mojo
09:10 zivester joined #mojo
09:36 meshl joined #mojo
09:42 jontaylor joined #mojo
09:57 mib_1qz1ow joined #mojo
09:58 mib_1qz1ow sri: take a look at https://github.com/kraih/mojo/issues/823
10:04 meshl joined #mojo
10:12 trone joined #mojo
10:26 meshl joined #mojo
10:48 Zx3 joined #mojo
10:49 meshl joined #mojo
11:16 neilhwatson joined #mojo
11:40 absolut_todd joined #mojo
11:45 mattastrophe joined #mojo
12:06 ZoffixWork joined #mojo
12:07 ZoffixWork joined #mojo
12:35 eitz joined #mojo
12:52 hernan605 joined #mojo
12:57 jberger mib_1qz1ow: if you are reading the log to see this, sri had been on a break for a while, please be patient
13:10 absolut_todd joined #mojo
13:13 batman jberger: i'm not sure _why_ it should be documented...
13:13 batman can't it be in the wiki or something?
13:14 pink_mist sounds reasonable to me
13:14 pink_mist to put it in the wiki that is
13:16 batman :)
13:26 gryphon joined #mojo
13:29 absolut_todd joined #mojo
13:31 jberger batman: I beat you to it
13:32 batman awesome!
13:32 batman jberger: i have a history of messing up my comments, so i'm glad you made one :)
13:37 absolut_todd joined #mojo
13:42 zivester joined #mojo
13:53 absolut_todd joined #mojo
13:54 bpmedley As an aside, the IntelliJ IDEA thing seems to be super sweet.  I assume it means that Mojolicious is attracting Java developers.. :)
13:56 bd bpmedley: is that good or bad? *scnr*
13:57 bpmedley bd: You say po-tatoe, I say potat-oe.. ;)
13:57 pink_mist 0_o I'm not sure how much use java devs would get out of Mojolicious 0_o
13:57 pink_mist I say potatis
14:00 njlg joined #mojo
14:02 Grinnz i say FIRE
14:07 Ptolemarch joined #mojo
14:08 absolut_todd joined #mojo
14:17 lluad joined #mojo
14:34 jontaylor joined #mojo
14:43 jontaylor joined #mojo
14:58 njlg joined #mojo
15:07 njlg Is there a method I can use in a Mojo::Lite app that is called after `$app->start` executes? e.g. `sub init {}` or `sub startup {}`
15:07 Grinnz_ in ::Lite that's kind of what the part of the script before app->start is for
15:10 jb360 joined #mojo
15:10 njlg okay. my problem is that I am trying to create an app that calls to another web service; and that webservice will make a call back to the app immediately. it seems like my app is not listening if I make the call before `app->start`.
15:10 bd njlg: maybe a timer can help?
15:11 Grinnz_ how are you listening for the response?
15:11 njlg @bd good idea. i was thinking of I could do that if there wasn't anything else.
15:11 Grinnz_ the app is not running before it's started, so yes that's probable
15:12 njlg Grinnz_ I give the webservice the app's location and route to call back on. The webservice tells me it is not responding. However, if I leave my app running and call my route, it seems to work. So, it seems like just a timing issue.
15:13 irqq joined #mojo
15:13 Grinnz_ yes, only during app->start will the event loop be running and respond to requests
15:13 Grinnz_ you could add a next_tick to run it once the app starts
15:14 Grinnz_ however, if you're doing a blocking wait for the response, you're going to block it from responding to requests as well
15:14 absolut_todd joined #mojo
15:14 Grinnz_ also, if you run it as a prefork server, each fork is going to run it
15:15 Grinnz_ https://metacpan.org/pod/Mojo::IOLoop#next_tick
15:15 njlg yeah. hmm. i'll try with `Mojo::IOLoop->next_tick` and see what happens. thanks for the help guys.
15:15 Grinnz_ are you doing a blocking or non-blocking request to this web service?
15:16 njlg non-blocking
15:28 PryMar56 joined #mojo
15:45 absolut_todd joined #mojo
16:03 mattastrophe joined #mojo
16:06 disputin joined #mojo
16:19 disputin joined #mojo
16:27 Ptolemarch joined #mojo
16:45 Mikey whats the best way to get the # of open websockets on a server?  i've tried counting successful connections and controller DESTROYs, but it leaks.  I've tried counting successful connections and finish-es, but it leaks there too
16:46 Grinnz what do you mean by leaks? incrementing a counter in the websocket action and decrementing it in the finish event should work
16:47 Mikey i mean that the counter always goes up.
16:47 Grinnz how are you storing the counter?
16:48 Mikey im looking at that now
16:49 Mikey im writing events to a socket pair that a daemon on the other side is listening to
16:50 Grinnz oh..
16:50 Mikey and inside that daemon
16:51 Mikey im doing ++ and -- on hashref values on an object
16:52 Mikey do you think some of those messages are getting lost.. i read somewhere that you can open a socketpair and then fork and the children will all be able to write to you from their handle
16:52 Mikey i might be wrong.  i might be dumb.
16:52 Mikey i mean, for sure they all can write sometimes, but what if two of them write at the same time.. does badness happen?
16:54 Mikey anyway thanks Grinnz all i was going for was a second opinion.  for sure finish will be called every time a websocket that was established  goes away
16:55 Mikey thats all i need to know, now i know my problem is somewhere else
16:55 Grinnz ah yeah, sharing the same end of a socket across forks could be a problem
16:56 Mikey i'll make a mutex to rule it out
16:56 Mikey because it only leaks by a little bit
16:56 Grinnz well, not just from one fork to the parent though, that is what socketpair is for like you said
16:56 Grinnz in that case they'd use different ends of the socket
16:56 Mikey like maybe 50 an hour with thousands of requests per minute
16:57 Mikey this is .. make the socketpair in startup before Prefork does its spawning
16:57 Mikey for a birds eye
16:57 Grinnz yeah... i wouldnt share a socketpair across prefork
16:58 Mikey not even with a mutex?
16:58 Grinnz seems like more trouble than its worth
16:58 Mikey meh how do i write to my stats daemon then
16:58 Mikey a log file
16:58 Mikey starting to sound much more appealing
16:58 Mikey a fifo would work too
16:58 Grinnz well, do you have any database in use for these processes
16:58 Mikey but i can't have my daemon blocking on reads
16:59 Mikey yes but i have avoided putting (local) system junk in the db.  the only system junk i put in there needs to be there cluster wide
16:59 Grinnz what kind of db?
16:59 Mikey postgres
16:59 Grinnz easy then, use pubsub :)
16:59 Mikey i already actually have a zmq bus across my cluster and thats what the aggregated stats are communicated with
17:00 Mikey so on startup i jettison a number of daemons from the mojo process
17:00 Mikey and the ipc works pretty solidly for the most part
17:00 Mikey one of these is a system agent.. it does stuff like monitor disk io, monitor load, monitor cpu use, etc
17:00 Mikey and on intervals communicates these back to a coordinator node
17:00 Mikey that will provision more worker nodes on demand based on the metrics
17:01 Mikey it communicates back up over zmq
17:01 Mikey i dont want the coordinator to get the individual events because it'd be a ton of data over an already noisy message bus
17:01 Mikey so if i do do something it'll be like a local file or something that i just write to and read from the system agent
17:02 Grinnz i dont know anything about zmq, but pubsub via postgres seems like an easy way to do it
17:02 Mikey it probably is.
17:02 Grinnz send events for increment and decrement, daemon is subscribed to those events
17:03 Mikey yeah it'd work.  no doubt.  not sure if it's the solution im looking for.  i'm thinking something more local.
17:03 Grinnz otherwise maybe you could use a unix domain socket, but i dont know anything about that...
17:03 Mikey i could use kill and signals
17:03 Mikey repurpose them for the counter increments and decrements
17:04 Mikey i only need 2 after all
17:04 Mikey that's even hackier than what im doing
17:04 Grinnz heh
17:04 Mikey yeah i use a domain socket to communicate with the coordinator node
17:04 Mikey i almost ended up doing that except socketpair worked so well :(
17:04 Mikey apparently not tho
17:05 Mikey anyway at least i know it's me now
17:05 Mikey thanks for the help
17:06 Mikey you know i could always just netstat and report the # of ESTABLISHED connections, that might be a more valuable metric anyway
17:07 absolut_todd joined #mojo
17:09 mattastrophe joined #mojo
17:14 mattastrophe1 joined #mojo
17:21 trone joined #mojo
17:27 trone_ joined #mojo
17:34 eitz Hello, is this a bug or feature? When posting a form (enctype = multipart/form-data) with an input (type=file, multiple) without any file selected and retrieving in Mojo with every_param, it shows up in the array as one asset, with no content and no filename
17:36 Grinnz_ eitz: if you mean $c->every_param, i am not sure. i use $c->req->upload for uploads usually
17:37 Grinnz_ (also there's every_upload)
17:38 Grinnz_ but to be honest, multiple uploads with the same name is pretty rare...
17:38 eitz Grinnz_, I was following this tutorial: http://mojolicio.us/perldoc/Mojolicious/Guides/Tutorial#File-uploads, and param is used for uploads
17:39 Grinnz_ yeah... $c->param is supposed to return uploads, as well as GET/POST params
17:39 trone joined #mojo
17:40 ZoffixWork joined #mojo
17:41 Grinnz_ rather: if there are uploads for that name, every_param/param will return the upload(s), otherwise it will return the GET/POST
17:41 ZoffixWork If I have a single app, but I want to run multiple instances of it (each would load a different config file).... Is Toadfarm something that could be of use to me?
17:43 Grinnz_ eitz: how are you determining how the upload shows up in the array?
17:45 eitz Grinnz_, The element shows up when I do this: my $arq = $c->every_param('files');  say $c->dumper($arq);
17:45 eitz Grinnz_, So I can't test it in a simple IF like: if (@$arq) { do_something(); }
17:46 Grinnz_ eitz: are you expecting multiple, or just one upload?
17:46 eitz Grinnz_, One or multiple files can be selected
17:47 Grinnz_ ok, try my $arq = $c->req->every_upload('files'); if (@$arq)
17:47 Grinnz_ the results should be the same if there were uploads
17:47 eitz Ok, thanks
17:47 Grinnz_ calling ->filename or ->size or ->slurp on each element should work
17:47 Grinnz_ https://metacpan.org/pod/Mojo::Upload
17:48 disputin joined #mojo
17:51 eitz Well, my bad, looks like the error isn't with mojo itself. Looking up with F12, I found out that the browser (Firefox) is really sending an empty asset.
17:51 eitz Thanks Grinnz_
17:52 Grinnz_ eitz: those methods should still work regardless...
17:52 Grinnz_ they will just be empty ;)
17:57 absolut_todd joined #mojo
17:58 Grinnz_ yay, green http://matrix.cpantesters.org/?dist=Mojo-SQLite+0.008
18:01 absolut_todd joined #mojo
18:06 ZoffixWork Any idea? I'm having trouble starting toadfarm even with a single app :/
18:11 ZoffixWork K, the answer is yes :) http://fpaste.scsys.co.uk/496517
18:22 irqq joined #mojo
18:41 amon joined #mojo
18:43 PryMar56 joined #mojo
18:52 absolut_todd joined #mojo
19:01 Ptolemarch joined #mojo
19:02 absolut_todd joined #mojo
19:04 mattastrophe joined #mojo
19:12 absolut_todd joined #mojo
19:15 disputin joined #mojo
19:16 absolut_todd joined #mojo
19:18 Ptolemarch joined #mojo
19:44 mattastrophe joined #mojo
19:47 absolut_todd joined #mojo
19:48 berov joined #mojo
19:51 dod joined #mojo
19:52 absolut_todd joined #mojo
20:03 disputin joined #mojo
20:08 mattastrophe joined #mojo
20:28 absolut_todd joined #mojo
20:46 absolut_todd joined #mojo
20:52 dotandimet joined #mojo
20:58 njlg joined #mojo
20:59 gryphon joined #mojo
20:59 absolut_todd joined #mojo
21:14 absolut_todd joined #mojo
21:29 dotandimet joined #mojo
21:29 absolut_todd joined #mojo
21:33 buu joined #mojo
21:36 tianon joined #mojo
21:42 buu joined #mojo
21:43 absolut_todd joined #mojo
21:52 irqq joined #mojo
21:59 absolut_todd joined #mojo
22:44 absolut_todd joined #mojo
22:54 absolut_todd joined #mojo
23:00 absolut_todd joined #mojo
23:14 absolut_todd joined #mojo
23:26 absolut_todd joined #mojo
23:47 Zoffix joined #mojo
23:47 PryMar56 joined #mojo
23:55 Zoffix joined #mojo

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