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

IRC log for #mojo, 2017-12-21

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

All times shown according to UTC.

Time Nick Message
00:00 Ya_ALLAH_Ya_Muhmd joined #mojo
00:00 Ya_ALLAH_Ya_Muhmd left #mojo
00:04 CandyAngel Okay, all fixed up
00:06 mohawk is it something like 'data://filename'?
00:07 pink_mist hmm? mojolicious doesn't have a way to refer to something in the __DATA__ section directly via a url?
00:07 pink_mist afaik
00:07 pink_mist you'd need to write a controller for that
00:08 Grinnz unless you mean templates in __DATA__, in which case you refer to them by name the same way as files in template/
00:09 pink_mist but not using a url
00:09 mohawk i want to put a "file" in the __DATA__, then pass to Mojolicious::Plugin::OpenAPI (which normally wants a file) something it will think is a file
00:12 CandyAngel Self-writing bios sucks :|
00:12 CandyAngel Err
00:12 CandyAngel bio's?
00:13 Grinnz mohawk: Mojo::Loader::data_section
00:13 Grinnz CandyAngel: biographies :P
00:14 Grinnz self-writing BIOS probably already sucks, if that exists
00:14 Grinnz s/already/also/
00:15 CandyAngel :P
00:26 CandyAngel jberger: Where would I put an avatar file?
00:26 jberger if you want me to host it, it would go in /static/
00:31 CandyAngel And what do I set image: to in site.yml to use that?
00:47 Ya_ALLAH_Ya_Muhmd joined #mojo
00:47 Ya_ALLAH_Ya_Muhmd left #mojo
00:50 superbluelotus joined #mojo
01:12 CandyAngel jberger: The github seems to be out of date with the site (missing day 20)
01:12 CandyAngel Shouldn't be a problem if I PR mine though..?
01:25 mohawk i just found this in one of Mojolicious::Plugin::OpenAPI's tests:
01:25 mohawk eval { $app->plugin(OpenAPI => {url => 'data://main/coercion.yaml'}); 1 };
01:28 mohawk so it appears 'data://{package}/{filename}' works fine
01:32 Grinnz mohawk: looks like JSON::Validator is what allows that https://metacpan.org/pod/JSON::Validator#schema
01:34 mohawk ha, ok
01:39 jberger CandyAngel: sorry about that, pushed
01:39 jberger So the way I've been doing the author info is in a section in the site.yml
01:40 jberger and then that is linked by name in the post's yaml header
01:40 CandyAngel I sent a PR :P
01:40 CandyAngel But as I noted, the avatar isn't working
01:42 jberger ah, the url includes /static/
01:42 CandyAngel I tried that, it didn't work :\
01:42 jberger that's different than in regular mojo
01:42 jberger really?
01:42 jberger hmmmm
01:42 CandyAngel [Thu Dec 21 00:28:40 2017] [warn] URL broken on /blog/2017/12/21/day-21-virtually-a-lumberjack/index.html: '/static/avatar_candyangel.png' not found
01:42 jberger it should, but I can check it out
01:42 CandyAngel Wait
01:43 CandyAngel It might be because I'm an idiot
01:43 CandyAngel Gah, it is
01:43 CandyAngel It's a jpg, not a png
01:43 pink_mist lol
01:43 jberger hehe
01:44 Grinnz shoulda made it a gif
01:44 CandyAngel I actually have a gif of my twitter avatar someplace :P
01:45 jberger can you rebase it against master now that I've pushed
01:45 jberger sorry about that btw, I rarely forget to push code
01:46 jberger then I'll do a local deploy, give it a read
01:46 mohawk what's the github url?
01:46 purl the github url is wrong, too
01:46 mohawk wise words
01:46 CandyAngel Won't the PR just work? I'm not changing anything you've changed?
01:47 jberger yeah, it should
01:47 jberger ok I'll just do that
01:47 mohawk Grinnz++
01:52 Ya_ALLAH_Ya_Muhmd joined #mojo
01:52 Ya_ALLAH_Ya_Muhmd left #mojo
01:55 jberger CandyAngel: could you link to the Mojo libraries you are talking about?
01:56 jberger to http://mojolicious.org/perldoc
02:00 jberger CandyAngel: very neat article!
02:01 jberger I think the only thing that I'd do would add "non-web" to really punch home that point
02:01 jberger "other non-web spaces like these"
02:01 jberger and then maybe include a few more sentences about HMD
02:01 jberger since the reader is likely unfamiliary
02:02 jberger s/y$//
02:02 jberger "HMD devices do blah and are used in blah to let users do blah"
02:02 jberger such like that
02:03 jberger make sure the reader understands your motivating case
02:04 jberger remember that their default expectation is web and so it is going to take some hand holding to change that expectation
02:06 jberger or just say Oculus Rift a few times ;-P
02:06 jberger maybe explain quickly what Yaw, Roll are, even generally
02:07 jberger "these are the technical terms for the ways that users can turn their heads"
02:20 CandyAngel jberger: Hope that is better
02:21 * jberger pulls
02:23 jberger yeah
02:24 jberger one more thing I've thought of is "Since it is usually used to receive file uploads, Mojo::Asset::File gives ...." but I can add that if you want to go to bed
02:24 jberger getting pretty late for you I know
02:25 CandyAngel Feel free to fix whatever you want :P
02:27 jberger merged
02:27 CandyAngel \o/
02:27 jberger CandyAngel++
02:27 jberger I won't release just yet
02:27 jberger I'll do that as I go to bed
02:28 jberger but thank you very much for the contribution!
02:28 jberger oh any idea what you want for a header image?
02:28 jberger maybe something as simple as someone wearing VR googles?
02:29 CandyAngel Why am I not surprised that there is actually a Lumberjack VR game :|
02:31 jberger https://commons.wikimedia.org/wiki/File:Woman_Using_a_Samsung_VR_Headset_at_SXSW_2015_(2015-03-15_14.10.24_by_Nan_Palmero).jpg ?
02:31 jberger https://www.pexels.com/photo/sky-woman-clouds-girl-123335/ ?
02:32 mohawk #winning
02:33 jberger I think I like the colors/aesthetic of the second one better
02:34 CandyAngel It's fine with me.. but I'm tired and might be in totally-not-care mode..
02:34 CandyAngel :P
02:34 CandyAngel If you can get one with the Deepoon E2 in it, that would be cool
02:34 CandyAngel (first HMD RE'd using that tool)
02:35 CandyAngel Hm
02:35 CandyAngel OpenHMD actually had a big banner image
02:35 CandyAngel But it is very plain so might blend in too much
02:35 jberger the problem is that it has to be licensed for reuse
02:36 jberger https://www.google.com/search?q=Deepoon+E2&tbas=0&tbs=sur:fc&tbm=isch&tbas=0&source=lnt&sa=X&ved=0ahUKEwiU_fz-iJrYAhUBySYKHcFLA_wQpwUIIA&biw=1440&bih=755&dpr=2
02:36 jberger no results
02:36 purl no results are in
02:38 CandyAngel https://pbs.twimg.com/media/C31HqoIXAAEzuZN.jpg:large
02:38 CandyAngel That's the banner they had
02:39 CandyAngel They are going to be well asleep by now so I can't get the actual image so.. use whatever you think is best
02:40 jberger I could put that in the article body
02:40 jberger if you like
02:40 jberger but that's not really a banner image
02:41 CandyAngel Oh wait
02:41 CandyAngel I actually found them :P
02:41 CandyAngel Surprise, they are on the team shared drive..
02:41 CandyAngel It's fine
02:42 jberger whatever you want
02:56 ilbot2 joined #mojo
02:56 Topic for #mojo is now 🍩 nom nom | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
03:54 webart joined #mojo
03:55 webart so ... when I do queries with Mojo::Pg ... I just copy them into scalars (refer to the Mojo::Pg object hash of results)  and work with them as needed ...
03:56 webart never thinking about or using statement handle
03:56 webart and everything is simple and just works ... but it probably wrong in some Web <-> DB theory kind of way
03:57 webart so thanks :-D
03:59 webart because super simple 10 line long web UI's frontends for DB  ... and if you scratch the surface you can go deeper and deeper and it's really well made ... like a self-driving car where you can push a button and learn to drive Formula One if you want
04:16 superbluelotus seems greate
04:18 superbluelotus :D
04:26 preaction what do i have to set to prevent mojo prefork command from killing workers too quickly? i set heartbeat interval to 6000 and graceful timeout to 6000 but it still kills them after 60 seconds
04:26 preaction i have a request that can take up to 2 minutes to process
04:37 dylan soo, it's not entirely set in stone yet... but in addition to a UX redesign for bugzilla.mozilla.org, I have to implement oauth in Q1, and I sort of specced this to be
04:38 dylan "embed a small mojolicious app that talks to our session store"
04:38 dylan which is a bit like putting some sort of jet engine in a jalopie.
05:05 marty joined #mojo
05:20 jnbek joined #mojo
05:39 jamesaxl joined #mojo
05:42 webart dylan: :-D ++
05:43 dylan it will take a while to port all of bugzilla but I think will solve a lot of annoying problems. :-)
05:43 dylan and it's the backend analog to the work my friend is doing on the front-end: https://bugzilla.mozilla.org/
05:44 webart "embed mojolicious client app to pull issues from github and automagically add to bugzilla installation"
05:44 Leffe joined #mojo
05:45 webart aka "gitbub"
05:46 webart oops gitbug ... gitbub is a good name though ... need to think of an app that goes with it :-P
05:46 dylan I was just going to use the github webhook psgi for that
05:46 webart yay++
05:46 dylan to think when I started adding new cpan deps was not allowed
05:47 dylan I guess that only changed because I wrote a rube-goldberg device to vendorize everything we use. https://github.com/mozilla-bteam/bmo-systems
05:47 webart plus the meme "CPAN is the language, perl is the VM"?
05:49 dylan Nobody cares about that.
05:49 webart heheh ... how about a Pegex parser for a YAML based bug report "grammar" ;-)
05:50 dylan LOL
05:50 webart I thought I saw one of those but it could have just been a youtube video of one of Ingy's presentations
05:52 jberger https://twitter.com/joelaberger/status/943720678662033408
05:52 jberger CandyAngel++
05:53 webart hehe nice background image - she's a theist  :-D  praying to the Camel gawd
05:54 dylan jberger: your tweets helped me decide on mojo btw. :-)
05:54 dylan (that and the very conformant and easy to apply oauth stuff from lee)
05:54 * jberger blushes
05:54 jberger Lee++
05:54 mohawk i wanted to be... a lumberjack!
05:55 jberger mohawk: hahaha
05:58 mohawk jberger, i PR-ed a couple of typo fixes
06:00 jberger mohawk++ deployed
06:18 webart jberger: been using Advent articles to convert a Catalyst toy app into a Mojolicious toy app
06:20 webart There's not much wrong with the Catalyst version ... but ... it's yuletide fun!! (yule for pagans used to be 2 months long not 12 days so I'm taking my time).
06:21 Grinnz thats what toy apps are for
06:24 jnbek joined #mojo
06:30 Vandal joined #mojo
06:33 Leffe joined #mojo
06:45 inokenty-w joined #mojo
06:45 a6502 joined #mojo
06:50 dod joined #mojo
07:09 dod joined #mojo
07:14 dod joined #mojo
07:30 tyldis How to get Content-Length of the response (using hooks)? (or do I have to check the size in after_render
07:30 kes joined #mojo
07:32 ladnaV joined #mojo
07:37 Leffe joined #mojo
07:39 dod joined #mojo
07:50 McA joined #mojo
07:55 AndrewIsh joined #mojo
07:59 mohawk why oh why am i suddenly getting "Inactivity timeout" from a mojolicious plugin test?
07:59 mohawk oh hang on - it's doing a "local" get, in response to a get
08:00 mohawk so i expect the second request is causing a deadlock
08:02 aborazmeh joined #mojo
08:05 swishy joined #mojo
08:05 mohawk is that a known thing? i'm predicting there's an easy fix
08:07 mohawk for starters, if i finally make gql work async, it ought to be able to just return a promise
08:07 mohawk which will then be "waiting", which will allow the other queued request to kick off, which can then conclude
08:09 trone joined #mojo
08:09 mohawk and that will mean OpenAPI::Client will need, as well as a "call", a "call_p" method
08:11 mohawk jberger, batman - fixing the above will be needed for my bit of batman's advent calendar post. it may be better to just go with his and i will try to get a followup ready in time for xmas ;-)
08:12 Grinnz apps sending requests to themselves is almost always a bad idea
08:12 Grinnz instead pull out the common functionality
08:13 mohawk normally i would agree
08:13 Grinnz actually not almost. always a bad idea
08:13 mohawk ok then
08:13 mohawk this is intended to be a GraphQL interface "wrapping" an OpenAPI that's on the same server
08:14 mohawk the gql bit is a plugin, as - obviously - is the OpenAPI
08:14 mohawk if there's a way to achieve this all running without making requests to the same server per se, i'm all ears :-)
08:15 Grinnz one will either need to provide helpers for the other to use, or you'll have to run them as separate servers
08:16 mohawk the separate servers thing seems like a failure
08:19 mohawk_pts similarly, to dig into each to start making them play well would feel like a failure of encapsulation
08:19 mohawk_pts however, making them all be async will definitely improve things
08:19 aborazmeh joined #mojo
08:19 mohawk_pts as well as being necessary anyway
08:21 Grinnz when you were doing a local get, did you do it blocking or non-blocking?
08:22 Grinnz blocking would definitely not work, non-blocking i'm not certain about
08:30 mohawk it was blocking
08:50 tyldis $c->res->content->asset->size :D
09:17 sri mohawk: i think you asked about this yesterday http://mojolicious.org/perldoc/Mojolicious/Guides/Rendering#Bundling-assets-with-plugins
09:19 sri jberger++ # btw
09:32 karjala_ joined #mojo
09:47 ghenry joined #mojo
10:05 tyldis How does Mojo behave if the client provides an incorrect Content-Length header? Is it vetted? Can I trust it? :)
10:43 Leffe joined #mojo
11:08 exp-innit joined #mojo
11:08 exp-innit is there a way to use url_for without any placeholders?
11:22 CandyAngel exp-innit: Any reason you think you can't?
11:23 exp-innit CandyAngel: my existing use seemed to take the placeholder from the current url
11:23 exp-innit and while they may be named the same, they are actually different in this case
11:23 exp-innit passing name => undef didn't seem to make any difference
11:24 CandyAngel You have two routes with the same name?
11:24 exp-innit no i have two routes with placeholders that have the same name
11:27 sri that would seem like a bug, if the described scenario is accurate
11:28 exp-innit I've got a meeting in literally 2 minutes
11:28 exp-innit and I hacked this in quickly
11:28 exp-innit I'll perhaps try and get a mojo lite example up later
11:28 exp-innit I added a stub path without placeholders and gave it a unique name, that did the job for now, i'll tidy up later
11:30 Lee joined #mojo
11:30 sri well, i can't look into it now, so please make sure to file a detailed bug report so it doesn't get forgotten
11:45 dotan_convos joined #mojo
11:53 Leffe joined #mojo
12:00 kes Hi. Why this did not work? $c->render( text => $result,  layout => 'v2' )
12:03 pink_mist the text renderer doesn't use a template?
12:24 Leffe joined #mojo
12:28 geospeck joined #mojo
13:09 Leffe joined #mojo
13:45 ghenry joined #mojo
13:53 tchaves joined #mojo
14:02 sri yea, i wouldn't mind getting this for xmas :O https://www.theverge.com/circuitbreaker/2017/12/21/16804850/lg-hdr-5k-ultrawide-monitor-ces-specs
14:05 sri that's almost two 4k displays next to another
14:09 gizmomathboy joined #mojo
14:09 sri always thought it was strange that there weren't 4k ultrawide displays on the market, they would rock for programming
14:09 dod1 joined #mojo
14:20 ChmEarl joined #mojo
14:21 exp-innit sri: 4k is a 16:9 'spec'
14:21 exp-innit ok it's a bit more than that
14:21 exp-innit but you can get high res ultrawides and have been able to for a while
14:21 gizmomathboy_ joined #mojo
14:21 exp-innit personally mine is just 1440p, but still
14:22 sri no you can't
14:22 sri all ultrawides have shitty low resolution
14:23 exp-innit 1440p?
14:23 exp-innit that's not particularly shitty
14:24 exp-innit seems their modern version of my monitor is 1600p
14:24 exp-innit not quite '4k' but still
14:24 sri that's only 720 pixels height with 2x scaling
14:24 exp-innit yes if you divide any monitor in 4 it will appear much smaller (?)
14:24 exp-innit a 4k screen is only 1080 pixels height with 2x scaling too
14:25 sri which is a fine resolution
14:25 exp-innit so 1080p is fine, but 1440p is shitty low?
14:25 exp-innit i'm honestly confused what you're looking for
14:25 exp-innit why would you measure a display by its pixel count / 4
14:25 sri you're trolling me right?
14:25 exp-innit no, i have no idea what you're aiming at
14:26 sri you don't get a high resolution display for more space, you get it to not see any pixels at 2x scaling
14:27 sri your native 1440p display does not have enough pixels for scaling
14:28 exp-innit but, I don't use 2x scaling
14:28 exp-innit what scenarios are you needing high res interpolation to 2x?
14:28 exp-innit certainly not going to be media on a 21:9 screen
14:29 sri if you've not experienced it you don't get it
14:29 sri high pixel density makes for much much much smoother text in editors and terminals
14:30 exp-innit sure, I have a 1440p laptop
14:30 exp-innit that is nice and smooth
14:30 sri no it really isn't
14:30 exp-innit well it's significantly smoother than the display you linked
14:31 exp-innit and you don't really get much more smooth unless you're buying some absurd ipad pro or whatever it is
14:31 Leffe joined #mojo
14:31 exp-innit but honestly I don't see the point, I'd rather use my pixel on more space personally
14:34 sri exp-innit: so, that's a 34" monitor?
14:34 sri at 1440p
14:34 sri that makes for 86.39 PPI
14:35 sri and a normal 27" 4k monitor has 163.18 PPI
14:35 sri that's a hell of a lot smoother
14:35 exp-innit sri: right I said my laptop, a 1440p 13.3" display
14:36 exp-innit I have experienced smooth font rendering, but I wouldn't say it's worth the loss of space imho
14:36 sri ...
14:36 sri we were talking about ultrawide desktop monitors
14:37 exp-innit right, and I both empathised and agreed with you, and your response was to deny the laptop was smooth?
14:37 sri ok, i'm ending this here
14:37 sri sorry folks, i shouldn't have engaged
14:38 Leffe joined #mojo
14:38 * exp-innit sighs
14:44 Pyritic joined #mojo
15:13 dod joined #mojo
15:13 dod joined #mojo
15:14 Leffe joined #mojo
15:15 ghenry joined #mojo
15:20 irqq__ joined #mojo
15:21 bc547 joined #mojo
15:27 dod1 joined #mojo
15:33 Leffe joined #mojo
15:36 kaare joined #mojo
15:44 blinky joined #mojo
15:50 sh14 joined #mojo
15:55 geospeck joined #mojo
15:59 gryphon joined #mojo
15:59 geospeck joined #mojo
16:05 geospeck joined #mojo
16:08 geospeck joined #mojo
16:09 geospeck joined #mojo
16:09 geospeck joined #mojo
16:10 geospeck joined #mojo
16:13 geospeck joined #mojo
16:14 geospeck joined #mojo
16:16 itaipu joined #mojo
16:19 chansen sri: the new iMac Pro doesn't look bad either ;)
16:24 sri chansen: true, still huge bezels though
16:28 sri i have this one on my desk at the moment http://www.lg.com/us/monitors/lg-32UD99-W-4k-uhd-led-monitor
16:28 sri an ultrawide version of that would be perfection i think :)
16:31 Grinnz exp-innit: since you're here i think you were what inspired https://metacpan.org/pod/Mojolicious::Plugin::Log::Any so maybe it will be useful
16:33 jberger mohawk: since you are attaching to the openapi plugin anyway, I wonder if the plugin could provide a way to dispatch to the mojo route that it establishes rather than having to call back into the application over http
16:33 chansen sri: =) I'm using an iMac 27 (from 2015) so you are more modern than I am ;)
16:34 sri chansen: you got 5k resolution though?
16:34 chansen yeah
16:35 chansen Has any one written any HAP (HomeKit accessory protocol) implementation using Mojo?
16:36 * sri is fighting with Mojo::RabbitMQ::Client atm. https://github.com/inway/mojo-rabbitmq-client/issues/11
16:38 sri the docs are really bad, took me some time to grok how it uses factory methods to build amqp messages that you call ->deliver on to send
17:05 mohawk jberger, conceivably. can you point me at docs that cover dispatching? and most of all, does it allow post-processing or is dispatching "that's it, yours now"?
17:06 mohawk woops, sri just answered that
17:06 exp-innit Grinnz: off for xmas now, but that's very kind, ♥
17:11 mohawk exp-innit, merry xmas
17:12 mohawk actually, the answer sri gave was about the assets thing, which i don't think i did ask? but the section right after it has a reference to "after_dispatch"
17:12 mohawk however, that doesn't look like a per-single-dispatch, it's just always on or off
17:12 mohawk what i'd have hoped for would be something like a promise interface that i could ->then
17:13 geospeck joined #mojo
17:14 mohawk and the bit after *that* in the linked doc, refers to streaming. it's got the "drain" concept, which conceivably could be an Observable
17:15 Grinnz isnt event emitting mostly that?
17:16 mohawk the way i'm thinking of it, "events" are a very high-level concept which streaming makes use of, which is great
17:16 exp-innit mohawk: and to you too ☺
17:16 mohawk Observables as i have just learned of them, are like promises but for a stream rather than a single result
17:17 pink_mist still sounds like events to me
17:19 mohawk it is "like" events, indeed
17:19 mohawk promises are also like them
17:19 purl okay, mohawk.
17:19 mohawk uh oh
17:19 sri drain is an event of an observable
17:19 mohawk promises?
17:19 purl it has been said that promises is http://i.imgur.com/7aTdI.jpg
17:20 mohawk sri, do you think there would be value in making a Mojo::Observable like Mojo::Promise?
17:20 sri we already have that
17:20 mohawk doh
17:20 sri Mojo::EventEmitter
17:20 purl Mojo::EventEmitter is more Mojo's version of IO::Async::Notifier
17:21 mohawk no ->then method?
17:22 sri under the hood this is what drain callbacks are implemented with http://mojolicious.org/perldoc/Mojo/Content#drain
17:23 sri $c->req->content is an observable
17:23 sri a subclas of Mojo::EventEmitter
17:23 sri modeled after node.js event emitters
17:26 mohawk seen, thanks
17:27 Grinnz ->on would be your ->then, to set a callback whenever it occurs, or ->once for just the next time it occurs
17:28 mohawk my gut says that an actual Mojo::Observable with a ->then would be an easier-to-grasp interface
17:28 mohawk i recognise i have certain blind spots: i basically cannot parse an "unless", pre- or post-fix
17:28 Grinnz event emitting was a lot easier for me to grasp than promises :P
17:28 mohawk and i struggle similarly with how to really use ->on
17:29 Grinnz it's just pubsub
17:29 mohawk in both cases, i "understand" them
17:29 mohawk but i can't really do much with them
17:29 Grinnz maybe you just need to write something using it
17:30 sri $c->on(finish => sub { say 'end of the request!' })
17:30 sri that's the easiest to "do" something with
17:31 Grinnz hooks on the Mojolicious object are also a special case of event emitting
17:32 mohawk sure
17:32 mohawk it seems "Observables" are a thing from RxJS
17:32 mohawk and that version doesn't have a "then"
17:33 Grinnz the word 'then' seems a bit confusing for that, since it doesnt just occur once and then do other things
17:33 mohawk agreed
17:33 mohawk let me find the place that made me think it was then
17:36 sri the most commonly used implementation of observables is most likely node.js
17:38 sri perl 6 calls them supply https://docs.perl6.org/type/Supply
17:39 sri which i liked
17:39 sri they have a block keyword for supplies that looks like for loop
17:39 sri *+a
17:39 mohawk i think it's an apollo thing
17:40 pink_mist I could see instead of ->on(foo => sub ...) the case for a ->on('foo')->then(sub ...)
17:40 sri and that loop runs automatically in a coroutine
17:40 pink_mist but it's not really very needed
17:40 sri or was it a thread?
17:41 pink_mist I think it can do either, depending on needs?
17:41 sri pink_mist: you mean ->once
17:41 sri on handlers run more than once
17:41 pink_mist possibly
17:41 mohawk if this idea were pursued, it really ought to have the same interface as the thing it's based on. so far it looks like the subscribing is done with ".do"
17:41 sri promises can only resolve once
17:42 pink_mist sri: I meant for mohawk wanting the ->then thing for observables
17:44 mohawk ahhh, it was this: https://blog.graph.cool/all-you-need-to-know-about-apollo-client-2-7e27e36d62fd
17:45 bit_shifter joined #mojo
17:45 mohawk it has a .then inside, but it's being called on a param that quite obviously is a promise
17:46 mohawk and the same article talks about Observables, which are fundamentally based on 3 events: next, error, completed
17:46 mohawk so very EventEmitter indeed
17:47 pink_mist much observable very eventemitter :)
17:47 Grinnz wow
17:47 mohawk the seed i would like to plant is that the word Observable be in Mojo, that those event names are in there, and the interface methods are the same as in (i think) RxJS
17:49 mohawk i think the method is indeed "do" - it takes 3 params: next, error, complete: http://reactivex.io/rxjs/class/es6/Observable.js~Observable.html#instance-method-do
17:52 sri we won't do that
17:52 jberger certainly not unless and until there is a spec, ala promises/a+
17:52 sri yea
17:52 mohawk good call
17:53 Grinnz someone could certainly write a blog post on event emitting, though...
17:54 sri for all we know this will win in the end https://nodejs.org/dist/latest-v9.x/docs/api/events.html
17:56 jberger I mean that's closer to the EventTarget api
17:56 jberger and the browser always wing
17:56 jberger wins
17:57 jberger https://github.com/jberger/Mojolicious-Plugin-Multiplex/blob/master/share/websocket_multiplex.js#L5-L61
17:57 jberger annoying that its just an interface you have to implement
17:57 jberger but you know
18:01 mohawk here's the proposed spec: https://github.com/tc39/proposal-observable
18:02 sri ok, what's the best blocking rabbitmq module on cpan?
18:10 dod joined #mojo
18:20 * coolo is following the bitcoin crash live :)
18:20 sri oh, what did i miss?
18:20 coolo nothing unusual in this market
18:21 coolo but the realtime data on e.g. bitcoin.de makes it real fun to watch :)
18:21 sri coinbase is not down yet, it can't be that bad :p
18:22 coolo the market seems torn if btc is cool or not - and drags down both in the process :)
18:24 coolo there it happened! first offer < 12K
18:24 disputin joined #mojo
18:24 coolo since I watch it went down 700eur
18:25 * coolo might enter at 2k :)
18:25 tyldis Hardly a crash considering it is still up 90% in 1 month
18:25 dod joined #mojo
18:25 tyldis A minot adjustment
18:25 tyldis minor
18:26 coolo tyldis: in a normal market, yes. in a bubble market, I don't believe so
18:26 tyldis My portfolio is just up 700% since May.
18:27 tyldis I'm not worried yet, it always comes down a bit after skyrocketing
18:28 tyldis If Coinbase wasn't so volatile I would short them and reap some short term profits...
18:28 coolo hopefully at least the 'get rich quick, buy bitcoin' spam will stop if there is a mild crash
18:32 sri no way i'll get bitcoins now
18:33 sri online shops are all removing the option to pay with bitcoins, it's purely for investment and illegal stuff now
18:33 sri there is just no way it won't completely crash
18:35 sri it makes no sense anymore for services like steam with the volatility and super high transaction costs
18:35 mohawk investment -> speculation? ;-)
18:38 sri yea
18:38 jberger sri: I used Crixa myself
18:42 jberger this was the last thing I was working on before this job collapsed
18:42 jberger so it wasn't anything like done
18:42 jberger but it was basically https://gist.github.com/jberger/6235eb997b26ab767847ce69d29c9d81
18:43 sri all those modules have not been updated in years :/
18:44 jberger likely tru
18:44 jberger +e
18:44 purl 2.71828182845905
18:44 jberger shut it purl
18:44 * purl shuts it
18:45 mohawk +pi
18:45 mohawk tsk
18:47 coolo now it's -1000eur already
18:52 Leffe joined #mojo
18:53 mohawk i'm sure it's just a temporary pause for breath before it rushes up to new highs #trolling #ThisTimeIsDifferent
18:54 mohawk sri, did i already ask whether it was possible to do dispatch_p?
18:55 sri mohawk: luckily you did not
18:56 mohawk i take it the idea does not appeal?
18:56 sri no
18:56 mohawk fair enough
18:57 mohawk i think that without such, doing a "dispatch" for the graphql -> openapi won't be possible because of the post-processing required
18:58 sri s/not appeal/not make sense/
18:59 dod joined #mojo
19:01 dod joined #mojo
19:05 mohawk sri, is there anything resembling dispatching, with per-request postprocessing?
19:05 mohawk my thought was that ->then would make a nice way to add such
19:06 Grinnz anything that takes callbacks can be manually wrapped in a promise
19:06 sri don't let my scepticism keep you from making a proposal
19:07 mohawk Grinnz, i'm with you
19:07 sri but you've asked my opinion without any details... so i'm not optimistic
19:07 mohawk ha ha, ok
19:07 mohawk well, with a little more detail
19:07 mohawk graphql is all about resolvers
19:08 mohawk the "convert plugin" what i made for openapi -> graphql adds a resolver that calls the openapi, then there is postprocessing by the resolver, then the result gets returned
19:09 mohawk (returned into mojo-land, i mean)
19:09 mohawk so far, all quite promise-able, and indeed i am adding that as we speak
19:10 mohawk as we know, there was a suggestion made that the "calls the openapi" bit, when it's actually local, could be achieved using dispatch
19:10 mohawk as alluded to above, that would ideally end up in promise form for returning as that
19:11 geospeck joined #mojo
19:16 coolo <11k - this is fun to watch
19:17 mohawk sri, as you can see the above is slightly vague, but i hope enough detail is there that it makes some sort of sense
19:18 mohawk until i've finished adding promise stuff to OpenAPI::Client and the gql resolver it will stay a bit vague, but i think this approach is what's needed
19:18 Grinnz coolo: oh you're talking about euros?
19:18 Grinnz i was like, its still 15k here...
19:21 coolo Grinnz: who cares about the dollar? with the inflation the us will get as soon as all these tax cuts are in place, you better invest into any bit you can get :)
19:21 Grinnz heh
19:21 trone joined #mojo
19:22 preaction mohawk: i don't think you explained that you want to call another mojolicious route from inside a mojolicious route
19:22 mohawk agreed
19:22 mohawk communication is an iterative process :-)
19:23 coolo Grinnz: but I don't know of another market place with realtime books
19:24 coolo https://www.bitcoin.de/de flashes nicely - it's like watching a bad tv show
19:24 Grinnz i'm watching https://www.tradingview.com/symbols/BTCUSD/
19:24 Grinnz the graph doesnt update in realtime unfortunately but the numbers do
19:25 Grinnz i suppose their 'interactive chart' does :P
19:31 Leffe joined #mojo
19:59 geospeck joined #mojo
20:07 disputin joined #mojo
20:07 mohawk gahh, where is "tap" defined?
20:07 Grinnz Mojo::Base
20:07 purl Mojo::Base is really about embracing minimalism and getting the most syntactic sugar out of as little code as possible
20:07 mohawk ha ha!
20:08 mohawk also: thanks, Grinnz
20:22 tyldis sri: Mojo::RabbitMQ::Client needs some love. It's on my roadmap Q1 2018 to work on the publisher API as I need it a $ork by then
20:50 mohawk sri, i just had a slight surprise with Mojo::Promise. the JS interface i'm used to is in perl term, return Mojo::Promise->new(\&if_resolve, \&if_reject), with ->resolve and ->reject as class methods
20:51 gryphon joined #mojo
20:51 mohawk is it too late to switch to something like that?
20:53 mohawk or it could just be highlighted as how things are done round here
21:02 sri mohawk: i've never encountered that JS api, it's not spec
21:02 sri tyldis: i think we might need to fork Mojo::RabbitMQ::Client
21:03 mohawk sri, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
21:03 sri exactly
21:03 sri that would be Mojo::Promise->new(sub {...})
21:04 sri or rather Mojo::Promise->new(sub { my ($resolve, $reject) = @_; ... })
21:05 sri i remember bringing that up when we originally discussed the Mojo::Promise design
21:05 mohawk woops, i have erred, it's Mojo::Promise->new(sub { my ($if_resolved, $if_rejected) = @_; ... })
21:06 mohawk however, i believe i'm right on the ->resolve/reject as class methods?
21:06 sri not quite either :p
21:06 sri in the js api those generate already resolved promises
21:06 mohawk right
21:06 mohawk that's what Mojo::Promise doesn't do
21:06 mohawk that was my surprise
21:07 sri i've also brought that up at the time
21:07 sri nobody really cared
21:07 mohawk yeah
21:07 mohawk i'm not incredibly fussed either
21:08 mohawk there's not a great difference between Promise->reject(...) and Promise->new->reject(...)
21:08 sri right
21:08 mohawk i would suggest documenting it though
21:08 sri not sure why
21:08 sri it's not like we advertise any compatibility to any js api
21:08 sri and promises/a+ does not require those
21:08 mohawk that is true
21:09 mohawk i had assumed part of the rationale behind bringing in promises was because it was a model people understand
21:10 mohawk so just a little doc note showing a difference from that model doesn't seem like a big ask
21:10 sri it is
21:10 sri but i can also see such notes make it more complicated
21:10 sri i'm all for clarifying the docs
21:11 sri but referring to apis we don't even try to immitate is weird
21:11 mohawk i hear you
21:12 Grinnz future has ->done and ->fail class methods that are sorta what you're talking about, but no constructor for then callbacks (which makes sense, it's not promises)
21:15 good_news_everyon joined #mojo
21:15 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vbSSW
21:15 good_news_everyon mojo/master 6ecf00c Sebastian Riedel: show examples too
21:15 good_news_everyon left #mojo
21:16 mohawk sri++
21:20 sri tyldis: i think ->declare_queue and friends might even be designed wrong
21:22 sri there seems to be only two events usually, success/error, and those are only emitted once
21:22 mohawk *cough*promises*cough*
21:22 mohawk what?
21:23 sri ->declare_queue(@args => sub { my ($err, $result) = @_; })
21:23 sri my $promsie = ...->declare_queue_p(@args);
21:23 mohawk heart emoji
21:24 sri it's not quite done right :/
21:24 sri now you have to do my $queue = $channel->declare_queue(...); $queue->on(success => sub {...}); $queue->on(error => sub {...}); $queue->deliver;
21:25 sri very unfortunate it's the only rabbitmq client we have at the moment
21:26 tyldis sri: I never got to use it in my code because I ran into issues and my Mojo skills were not up to speed. I just got even more confused looking at the code.
21:28 tyldis The author based it on the AnyEvent client
21:34 berov joined #mojo
21:34 tyldis And I guess it shows.
21:39 sri i'm bringing it up https://github.com/inway/mojo-rabbitmq-client/issues/13
21:45 tyldis sri: we might be able to contribute dev resources in January
21:46 sri it's not reallt much of a priority at work, so i guess i can't contribute much
21:46 sri s/t/y/
21:47 sri in fact i was hoping to get rabbitmq notifications added to an app in like a day :S
21:48 sri might have to ignore the borked consumer for now and just use the publisher, which seems to work well enough
21:49 tyldis We might givw it
21:49 tyldis Give it a go, appreciate if you can comment as we go
21:50 sri sure, now that i'm familiar enough with rabbitmq
21:52 tyldis 🐰
22:21 Leffe joined #mojo
23:09 karjala_ joined #mojo
23:14 ghenry joined #mojo
23:20 berov1 joined #mojo
23:47 gryphon_ joined #mojo

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