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

IRC log for #mojo, 2017-02-13

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

All times shown according to UTC.

Time Nick Message
00:16 bpmedley joined #mojo
00:17 bpmedley jberger : CarPark looks really sweet
00:27 disputin joined #mojo
01:14 kiwiroy joined #mojo
01:16 jberger bpmedley: thanks
01:16 jberger I'm hoping with the blog post it will even be a little sweeter
01:20 cfedde joined #mojo
01:20 a6502 joined #mojo
01:25 bpmedley Just tossing this out there: using auth0.com with Mojo seems pretty cool (at least early on).
01:52 veryrusty joined #mojo
01:54 howitdo joined #mojo
01:55 cpan_mojo Mojo-ACME-0.09 by JBERGER https://metacpan.org/release/JBERGER/Mojo-ACME-0.09
01:56 jberger ok, for the first time, I have demonstrated certs with multiple names
01:56 jberger I didn't have a way to test that before
01:56 jberger all working now
01:58 jberger and I have all my personal sites using the same cert
01:58 jberger and reusing the same nginx ssl termination code
01:58 jberger kinda fun
02:24 stryx` joined #mojo
02:34 kiwiroy joined #mojo
02:35 veryrusty joined #mojo
02:41 asarch joined #mojo
02:41 zach genio: bpmedley how would you show the progress and/or that the job failed in either of those scenarios?
02:42 pink_mist zach: javascript
02:46 purl i guess javascript is a language built entirely out of umbrellas or for people not from Oregon or hard to freakin' test properly or a symlink to broken or testbed at http://jsfiddle.net or http://666.is/link/5932 or a dynamic computer programming language
02:46 * jberger high fives purl
02:46 jberger oh, that should totally have a factoid
02:46 zach pink_mist: what, have a javascript timer that that does a rest call that based on the data returned updates a specific object on the page?
02:46 bpmedley zach : What I've seen people talk about is, in the Minion job, store a progress percent (or state) in the datastore and then query that via AJAX or somesuch..
02:46 pink_mist yes, or via websockets, as was suggested
02:46 bpmedley pink_mist : Sorry, I missed that
02:46 pink_mist no, I was answering zach, not you
02:46 zach pink_mist: if I'm not already implementing websockets though, would that not be a much more complicated thing to do?
02:46 pink_mist not really
02:46 bpmedley zach : https://github.com/kraih/mojo-pg/blob/master/examples/chat.pl <-- Here's a really cool example of websockets
02:50 zach :\
02:51 bpmedley zach : What's wrong?
02:51 purl but it feels so right
02:53 zach so, a websocket is neither a get, nor post, nor put, nor delete, it's just a websocket and the route that it has to hit and then magic happens
02:53 zach I've never done a websocket before
02:53 bpmedley zach : A websocket starts out as a GET and is upgraded.
02:56 bpmedley zach : http://mojolicious.org/ <-- Duct tape for the HTML5 web : do you see how that example is working?  You might copy it into a file and run the lite app..
02:56 zach are you referring to the balloon?
02:57 bpmedley No, do you see code with this comment: WebSocket service used by the template to extract the title from a web site ?
02:58 zach oh, the literal headline of duct tape....
02:58 zach sorry, I'm an idiot
02:58 bpmedley No, you're just a little overwhelmed, and it's understandble..
02:59 genio bpmedley++
03:00 zach thanks
03:02 kiwiroy joined #mojo
03:04 zach so, basically, each step of the sub that's doing the work on the backend should have a message => sub {} and then in that sub there should be a send with the status to send? can there be multiple sends in a sub? if there's a sub foo { bar(); baz(); biff(); } can each of those do a send to the same websocket if the websocket '/status' => foo is like that?
03:04 jberger zach: before being talked all the way through websockets, you might want to read the Tutorial and the Guides
03:15 zivester joined #mojo
03:17 perlpilot joined #mojo
03:19 ningu the jetsons had websprockets
03:19 jberger ningu++
03:23 zach what?
03:26 bpmedley zach : Have you seen the jetsons cartoon?
03:38 noganex_ joined #mojo
03:39 zach yeah
03:40 zach also, can a websocket post or is it only a get?
03:40 zach like, can the websocket for status receive an id for say a job or something about what it's getting the status of
03:40 Grinnz the websocket initiation doesn't need to be post, you can send anything across it once it's connected
03:42 ningu it's just data
03:42 ningu you decide what goes in
03:42 veryrusty joined #mojo
03:46 zach wait wait wait
03:48 zach so I have a button that does a post to clone a VM, should the button actually itself hit a websocket to create the VM and the websocket launching a minion before rendering and the minion sends to the websocket at each update of the process instead of the post going to its own route and then another route for a websocket and javascript connecting to and watching the websocket?
03:48 Grinnz that was a lot of words in a row
03:48 Grinnz if you're going to use a websocket, you can establish it on page load and then have the button send the command over the existing socket
03:49 bpmedley zach : Have you created a smallish lite app that uses Minion?
03:49 ningu yes, on page load is the normal time to start it up
03:49 zach bpmedley: no, and this is a full app
03:49 purl okay, zach.
03:49 zach but I'm also thinking about using this in an even bigger app that I have in a separate setup elsewhere
03:50 bpmedley I would create a smallish lite app and tinker..
03:50 zach Grinnz: can you guard a websocket route the same as a rest route?
03:51 zach my $authorized = $r->under('/')->to('user#is_logged_in');
03:51 ningu there are websocket routes? now we're getting to a point I don't know about in mojo :)
03:52 bpmedley zach : I think the initial GET request will honor the under.
03:52 preaction yes, the handshake is a GET request and follows all the routing rules
03:53 ningu oh so in this context 'websocket route' means 'route for establishing a websocket'
03:53 ningu not the data passed over the socket
03:53 preaction yes
03:53 preaction $r->websocket( ... )
03:53 zach preaction: $authorized->websocket
03:54 preaction that will work, yes
03:54 preaction you can even, in the controller method / callback, send back an error instead of setting up the websocket
03:55 ningu so by default does mojo just use standard/normal websockets, and not any kind of wrapper library on the client side?
03:55 preaction standard websockets, yes
03:56 Grinnz mojo doesn't do anything to the client side
03:56 Grinnz that's up to you
03:56 ningu Grinnz: right, but if you wanted to fall back to long polling you'd need server support
03:56 zach what is long polling?
03:56 purl long polling is just a fancy name for a response body with unknown length or not so great, since they cut off connections after 30 seconds
03:56 preaction yes. you'd need client support
03:56 zach I love purl
03:57 ningu preaction: yeah but you'd also want to be able to define it as a single route on the server side, ideally
03:57 ningu and have it just work
03:58 ningu zach: long polling is basically a workaround for when proper websockets aren't available (for various reasons)
03:58 preaction i wouldn't, because i think it's pointless, but you could certainly set up a get and a websocket route that do what you want
03:58 Grinnz the client would have to decide to do the fallback
03:59 ningu Grinnz: right, but it seems like it would be a pain to implement it on the server side so it works the same as the websocket, unless the server is designed to handle that case
04:00 ningu I am thinking of socket.io here
04:00 preaction yes, long polling is a pain
04:00 Grinnz everything that came before websockets is a pain to implement like websockets
04:00 Grinnz that's why websockets happened
04:00 ningu it takes care of all of this for you
04:00 preaction there's a socket.io server in perl. no idea how good it works
04:00 ningu I also don't know how often long polling is still necessary these days
04:01 preaction it never has been
04:01 Grinnz http://caniuse.com/#search=websockets
04:01 ningu it would be necessary if the browser doesn't support websockets or if a firewall blocks them
04:01 zach can an html form post to a websocket?
04:02 Grinnz no
04:02 Grinnz but if you have it post via javascript it could
04:02 zach but then the post would be a send, right?
04:02 Grinnz yes
04:02 ningu I wouldn't call that post, but yeah :)
04:03 preaction you could set up the websocket for notifications outside of whatever it is you're doing
04:05 ningu apparently you can include an http body with a GET request. no one ever does, but it isn't forbidden
04:06 Grinnz it is very strange, though
04:07 genio Well, I think the XPS 15 is winning over the new MBPs in my mind. I need a new machine.
04:07 ningu genio: hardware-wise I agree. but I am pretty used to macOS
04:08 ningu I'd probably go for ubuntu if I had to switch
04:08 genio as am I. but... that stupid touchbar
04:08 ningu haha yeah
04:08 ningu there is one without it now too, isn't there?
04:09 tyldis The prices for these beasts, though
04:11 ningu ubuntu has a lot to recommend it, can be a bit rouch around the edges as a desktop though
04:11 ningu rough*
04:11 ningu and not sure about battery life
04:11 ningu but with MBP these days not sure either, so...
04:12 tyldis I've been running Ubuntu as exclusive desktop for a year, very happy with it. And I actually like Unity for it's shortcuts. I never see the UX, thanks to alt-tab and alt-pipe
04:13 tyldis Two years actually
04:13 genio my 2011 MBP is in its final days.
04:13 ningu I like unity as well
04:13 genio *sad genio*
04:13 ningu mine is 2015, will last a while longer
04:13 genio MacBook Pro (15-inch, Late 2011)  so, I probably got it in 2012
04:14 genio it's lasted a while for me
04:14 ningu MacBook Pro (Retina, 13-inch, Early 2015)
04:14 genio but I can't run Chrome anymore. FF is getting worse and worse with it.  :/
04:15 genio and my touchpad is getting annoying in places
04:15 tyldis I got an Asus UX305. Very happy with it as well for web and coding, however looking into more horsepower for photo editing. Works with Ubuntu without tweaks and lasts 8 hours on a charge.
04:18 veryrusty joined #mojo
04:23 kiwiroy joined #mojo
04:23 aborazmeh joined #mojo
04:56 absolut_todd joined #mojo
05:04 dboehmer_ joined #mojo
05:23 inokenty-w joined #mojo
05:42 prajith joined #mojo
05:43 prajith is it poosible to pass IO::Socket::UNIX directly in to ioloop->client ?
06:14 dikim joined #mojo
06:15 aborazmeh joined #mojo
06:22 veryrusty joined #mojo
06:58 ccakes joined #mojo
07:03 kaare joined #mojo
07:06 stryx` joined #mojo
07:16 dod joined #mojo
07:22 Vandal joined #mojo
07:29 ashimema joined #mojo
07:34 ccakes joined #mojo
07:44 marcus genio: time to install linux on it? :)
07:52 ccakes joined #mojo
08:03 mbudde joined #mojo
08:05 AndrewIsh joined #mojo
08:09 kiwiroy joined #mojo
08:26 trone joined #mojo
08:33 faraco joined #mojo
08:33 rshadow joined #mojo
08:34 faraco Hi, how would I do this? https://timestamp-ms.herokuapp.com/1450137600. How to pass the string as a parameter itself in Mojo?
08:34 faraco (no need to use like foo?string)
08:35 bpmedley faraco : http://mojolicious.org/perldoc/Mojolicious/Guides/Tutorial#Placeholders
08:37 faraco I can't believe I missed that. Thank you!
08:38 cpan_mojo joined #mojo
08:38 cpan_mojo Mojo-ACME-0.09 by JBERGER https://metacpan.org/release/JBERGER/Mojo-ACME-0.09
08:38 cpan_mojo Mojo-mysql-1.00 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojo-mysql-1.00
08:38 cpan_mojo Mojo-Pg-3.01 by SRI https://metacpan.org/release/SRI/Mojo-Pg-3.01
08:38 cpan_mojo Mojo-IRC-Server-Chinese-1.8.1 by SJDY https://metacpan.org/release/SJDY/Mojo-IRC-Server-Chinese-1.8.1
08:43 sri genio: the 15" XPS is a pretty good machine, but i just can't get used to the keyboard, it's worse than even the new macbook keyboard imo.
08:50 ningu when I was in tibet I typed on a gheeboard but it was too greasy
08:54 sri genio: you can still buy a 2015 15" macbook though
08:58 wardenm joined #mojo
08:59 rshadow joined #mojo
09:06 kaare joined #mojo
09:46 polettix joined #mojo
09:53 sugar joined #mojo
10:12 coolo sri: did you pull 7.24? http://www.cpan.org/authors/id/S/SR/SRI/Mojolicious-7.24.tar.gz is 404
10:13 sri coolo: yes, old releases are only kept on backpan
10:14 sri backpan.metacpan.org/authors/id/S/SR/SRI/Mojolicious-7.24.tar.gz
10:19 coolo is there an URL I can use that will hold 200 for longer than 3 days?
10:28 trone joined #mojo
10:29 sri the metacpan mirror i think, which is a backpan
10:29 stryx` joined #mojo
10:29 sri yea
10:29 sri https://cpan.metacpan.org/authors/id/S/SR/SRI/Mojolicious-7.24.tar.gz
10:30 sri no need for the backpan prefix
10:30 sri it's the preferred mirror in the community now i think, https and backpan
10:31 sri we use it for the install one-liner everywhere too
10:31 sri curl -L https://cpanmin.us | perl - -M https://cpan.metacpan.org -n Mojolicious
10:32 sri and i think it might be on the fastly cdn
10:33 * sri nods
10:34 sri definitely on fastly
10:35 nic heh, that confused me for a sec.  Was reading the "-M" as a option of 'perl' :D
10:36 haarg www.cpan.org is also on fastly, and iirc is supposed to be available via https, but it doesn't seem to be set up correctly
10:36 purl okay, haarg.
10:37 haarg i haven't see much reason to use anything other than cpan.metacpan.org though
10:45 coolo sri: good, changed my spec generator
10:56 stryx` joined #mojo
11:10 px80 good morning
11:10 purl For you maybe.
11:13 px80 I have some performance questions regarding my code
11:14 px80 if someone has a free slot and would like to have a look, I would be happy to share it
11:21 sugar joined #mojo
11:28 foursixnine joined #mojo
11:37 sugar joined #mojo
11:38 kes joined #mojo
11:50 mbudde joined #mojo
11:51 sugar joined #mojo
11:52 sri oh, next week is suse hackweek, so i'll need to pick a project, if anyone wants to make a last minute suggestion ;)
11:52 sri currently i'm favoring event loop diagnostics
11:54 sri (https://hackweek.suse.com)
12:10 kiwiroy joined #mojo
12:12 gregf_ joined #mojo
12:23 px80 sounds good :)
12:26 sugar joined #mojo
12:31 px80 inside of ua->get callback I do another ua->get with same delay object
12:32 marcus joined #mojo
12:32 px80 reason is that I want the subsequent get to happen instantly after first one
12:33 px80 this is all is surrounded by a loop of many urls, where the second get is another loop of many urls
12:34 px80 first loop is like 15 servers, second ua->get inside of callback is another 20 URLs from one server
12:34 px80 so its about 300 GETs
12:36 px80 I wonder now about this:
12:36 px80 using only one server:
12:36 px80 ./nonblocking-delay.pl  1.43s user 0.13s system 77% cpu 2.006 total
12:36 px80 two server:
12:37 px80 again
12:37 px80 one server:
12:37 px80 ./nonblocking-delay.pl  0.53s user 0.06s system 82% cpu 0.710 total
12:37 px80 two server:
12:37 px80 ./nonblocking-delay.pl  0.80s user 0.11s system 82% cpu 1.097 total
12:38 px80 three server:
12:38 px80 ./nonblocking-delay.pl  1.17s user 0.10s system 84% cpu 1.507 total
12:38 px80 four server:
12:38 px80 ./nonblocking-delay.pl  1.43s user 0.13s system 77% cpu 2.006 total
12:38 px80 and so on
12:38 px80 is this because of event loop processing time? so overhead in total?
12:39 px80 or is there something not really running in parallel?
12:39 nic using a pastebin would be preferred for that
12:40 px80 IRC should also transport some payload, not only protocol overhead and connection messages ;-)
12:41 px80 as long as data is not considered protocol overhead itself
12:45 tchaves joined #mojo
13:11 stryx` joined #mojo
13:41 sugar joined #mojo
14:08 gizmomathboy joined #mojo
14:09 kiwiroy joined #mojo
14:19 gryphon joined #mojo
14:23 genio sri: I really like the keyboard on my 2011 MBP. I planned on dropping by best buy today and playing with the XPS machines.  The 2015 MBP is just so expensive to get it even to the same HDD size and amount of RAM as my current machine
14:23 genio $2,500.00 is a LOT
14:24 genio I can get somewhere around $400 for my current mac.
14:36 itaipu joined #mojo
14:39 itaipu joined #mojo
14:42 Lee joined #mojo
14:50 sugar joined #mojo
15:38 mrEriksson genio: The XPS s very nice, though, you'll be limited to Windows or Ubuntu on it, other linux dists aren't really bleeding edge enough with their kernel versions
16:08 marty joined #mojo
16:09 bwf joined #mojo
16:12 PryMar56 joined #mojo
16:12 zivester joined #mojo
16:20 sh14 joined #mojo
16:23 disputin joined #mojo
16:27 simak joined #mojo
16:27 simak left #mojo
16:43 Lee joined #mojo
16:44 vicash genio: i just buy Lenovo T450 or Lenovo T420 refurbished for cheap and upgrade RAM and replace HDD with SSD to get a pretty good performing laptop. the T450 is light enough but has a 5th gen i5 and the T420 has a 2nd/3rd gen  i7 which is also quite fast. Overall cost ranges between $400-500 including upgrades. The thinkpad keyboards are great
16:50 genio vicash: My hangup there is the terrible-ness of the lenovo touchpads (we have them at work and I hate hate hate)
16:56 dod joined #mojo
16:59 vicash genio: i dont use the touchpads.. i use and love the trackpoint, allows you to never have to move your hand off the keyboard. trackpads are an abomination in every non-apple laptop
17:00 genio we are polar opposites on that topic. :/
17:03 lluad joined #mojo
17:09 jabberwok joined #mojo
17:09 kiwiroy joined #mojo
17:12 sri genio: don't expect too much from the xps trackpad
17:21 Grinnz coolo: pretty sure cpanm also automatically uses backpan for specific versions
17:21 Grinnz even without using the metacpan mirror
17:23 Grinnz mrEriksson: surely fedora is? on 4.9.8 atm
17:23 zach yeah, fedora is always bleeding edge
17:25 genio sri: I'm leaning more and more to just ponying up the money for a 2015 mbp.  If I get 5+ years out of that one as well, then I guess it's worth it
17:27 sri genio: the sad thing is, the 2015 is faster than the 2016
17:37 zach does it make sense to take any and all potentially slow operations and make them websockets instead of REST so that you can then have updates in the page and immediate responses?
17:37 zach I guess the alternative would be to kick off the job and report back the job id or something like that
17:42 cpan_mojo Test-Mojo-Role-Selenium-0.07 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Test-Mojo-Role-Selenium-0.07
17:47 stryx` joined #mojo
18:06 stryx` joined #mojo
18:08 orev joined #mojo
18:33 kes joined #mojo
18:33 kes_ joined #mojo
18:34 dantti_laptop joined #mojo
18:42 rshadow joined #mojo
18:43 disputin joined #mojo
18:45 disputin1 joined #mojo
18:46 sugar joined #mojo
19:04 itaipu_ joined #mojo
19:12 stryx` joined #mojo
19:14 gizmomathboy joined #mojo
19:16 howitdo joined #mojo
19:25 kiwiroy joined #mojo
19:29 itaipu joined #mojo
19:30 cpan_mojo joined #mojo
19:30 batman cpan_mojo is hopefully more stable now...
19:51 Pyritic joined #mojo
20:00 zach is it crazy to have mojo create templated javascript, like, for a wss uri to have mojo create the uri that it connects with when rendering?
20:01 jberger zach: I've been playing with things for that
20:02 zach things for that as in it's a bad idea to do it in a normal template file?
20:02 jberger at $work I have one mojo-templated javascript file that basically just creates a few global variables containing urls
20:02 jberger then that file is included with a script tag in other places
20:02 zach hmmm
20:02 zach wait
20:03 zach so you don't actually have it in the html?
20:03 jberger you can do both, but I like the idea of keeping the server-side templating and the client-side templating as separate as possible
20:04 jberger but if you are careful, and if your client-side templates are more mustache-like than mojo-like then you should be ok
20:04 pink_mist I don't think that would work for zach; imported javascript files tend to be cached rather thoroughly
20:04 jberger you can always set the caching off for that file
20:04 jberger anyway, are those urls likely to change a lot?
20:05 jberger they are usually base urls for an api (at least in my case)
20:05 zach jberger: well, I'm thinking, if they change the IP/hostname of the system it's deployed on to have it auto change the URL it goes back to because all my REST ones are relative
20:05 zach it looks like my wss needs a full path though from the examples I see
20:06 zach ....so I was just thinking something like wss://$mojo_host/route/to/ws
20:06 jberger can a url have a scheme but not a host?
20:06 jberger wss:///some/path ?
20:06 jberger I've never tried
20:06 pink_mist don't think so, but ... never tried either
20:07 zach if it did that would it know to connect back to the same host as all the rest stuff does?
20:07 jberger that's how I would interpret that
20:07 gizmomathboy joined #mojo
20:07 zach this is my first jump into websockets
20:07 jberger I usually just use a full path
20:07 jberger I'd probably suggest using the full path for now
20:07 zach I'm not against a full path but I don't want to hardcode it, I want it to be able to put a variable for the fqdn or ip of teh host in there
20:08 jberger then you server-side template it in
20:08 zach well, I meant like templates/route.html.ep
20:08 blumbi joined #mojo
20:09 zach I always use the built in templating thing, never did moustache
20:09 jberger moustache is what you are likely using in the client-side template
20:10 zach whatever is default in mojo
20:10 zach it looks kind of erb like
20:10 zach like ERB minus the < >
20:10 jberger oh, if you aren't using any client-side rendering then yes, just use mojo to template the url into the javascript on the server side
20:10 jberger sorry
20:10 jberger I thought you were templating on both sides
20:10 zach I'm confused
20:10 zach how/why would I template on the client side?
20:11 jberger ok, forget everything I've said
20:11 purl jberger: I forgot everything i've said
20:11 jberger :o
20:11 jberger <zach> is it crazy to have mojo create templated javascript, like, for a wss uri to have mojo create the uri that it connects with when rendering?
20:11 jberger no, that's fine
20:11 jberger not crazy
20:11 zach I'm using a little JS that I'm going to shove into a html.ep file in the templates that's going to connect with a wss back to the mojo server
20:12 zach I just figured it would update a label or something to say what the status of something was
20:12 zach Actually, I need some advice
20:13 zach so I know my existing version is stupid, but I need advice on one of two alternative ideas I had
20:13 zach so, current is hang forever doing a clone operation, but if you refresh it's fine
20:14 zach new idea is either, Minion in background create a task id and drop that in the DB and track status and times with each step updating the DB and then make a page that shows all the jobs in the DB where you can look up the status of each job
20:14 zach second idea that I'm trying to do, Minion in the background, connect with wss and auto update the status of the task in the UI in realtime, screw the DB
20:15 zach I honestly don't know which sounds better
20:17 jberger in the second scenario the minion task starts up a server of its own?
20:17 jberger that sounds really bad
20:18 zach yeah
20:19 zach the first is a little more like what AWS does, except I think they have JS that constantly does GET to check on the status of the various parts
20:19 jberger if you had a fanout relay running in the main server, you could have the minion task call back to that via either a websocket or even just http, then listeners on the relay could get push notifications over a websocket
20:19 zach I don't know what a fanout relay is, so I probably shouldn't do that
20:19 vicash zach: for a similar status update with a long running minion job scenario, i use a Websocket GET request on a timer. it is simple, less prone to breakage and not CPU intensive
20:19 jberger see Mercury
20:20 zach Mercury?
20:20 purl Mercury is probably Something Else Entirely.
20:20 zach vicash: yeah this job can take 5 minutes
20:20 jberger hmmm, it might be too early to tell you about message buses
20:21 zach I understand what a message bus is, I don't know what a fanout relay is
20:21 jberger its a bus pattern that has one writer and many readers
20:21 zach ok
20:21 jberger the message "fans out"
20:21 zach vicash: why websocket and not a timer just doing a RESTful GET?
20:22 vicash zach: my jobs can take an hour, so i have a websocket route that checks the intermediate status in the DB and the minion task updates the DB with intermediate status and data. Websocket keeps the connection open.
20:23 vicash zach: so instead of doing a GET request, I just send a message like "status" or something simple and small on the socket and receive the status accordingly without making new GET requests and polluting the log files.
20:24 vicash zach: I don't have more than 5-10 users so I am not exhausting sockets on the server. but if you have several, maybe a different design is needed.
20:25 jberger zach, perhaps you're right, maybe it is just best to poll from the browser back to a tiny service you write that just checks the minion job status
20:25 zach I won't have more than 10 users
20:25 jberger that's a very simple thing
20:25 zach at least on this specific app
20:27 vicash zach: i would go with the simplest design that you're comfortable with and then see if that satisfies your requirements.
20:27 zach I'm not comfortable with any of these things involving auto updates, I'm learning them on the fly for this and trying to figure out which is the simplest and/or best for the purpose
20:29 rshadow joined #mojo
20:31 vicash zach: it took me very less time to design the websocket stuff, i just followed the websocket examples in the Mojolicious guides... since i only need status updates on the browser, it was good enough. if you're planning on consuming status updates via other applications such as bots, then it makes sense to use REST
20:36 itaipu joined #mojo
20:43 jberger you know, it would be kinda cool if Minion::Notifier had a an extra "state"
20:43 jberger like a progress announcement
20:43 jberger https://metacpan.org/pod/Minion::Notifier
20:43 blumbi I'am currently using Mojo just for client side stuff, no mojolicious or server side things. Now I consider also Mojo's templating system. Does it make sense to switch in such case from Template Toolkit?
20:43 jberger it wouldn't fire by itself, but your job could do it
20:43 jberger blumbi: if you are comfortable with TT and are already using it, then probably not
20:44 jberger I like Mojo's Embedded Perl templates, but consider transition costs
20:44 blumbi To be honest, not much comfortable yet.
20:45 jberger in that case, yes I'd recommend EP, it isn't a whole new syntax to learn, after you learn the template marks it is just ... embedded perl :-P
20:45 jberger TT is an entirely different language, which some people prefer but I definitely don't
20:45 blumbi can I natively open external files?
20:46 jberger what do you mean by that?
20:47 blumbi without using mojolicious, I can't find native way to directly act on files
20:47 blumbi open, read, parse, process, put into string
20:47 jberger you would probably do that in a controller if not a model method
20:47 jberger but it really depends
20:47 jberger its a hard question to answer in the abstract
20:47 blumbi as said I don't use controllers / mojolicious
20:48 jberger so this isn't a webapp at all, just a template
20:48 jberger ?
20:48 blumbi its not a webapp, I'am using useragents, dom stuff primary, and tcp client
20:48 jberger in that case, you would probably use Mojo::Template directly
20:49 jberger but any amount of file manipuation you do inside of a template is really painful
20:50 jberger what I'd probably suggest is have a function that acts kinda like a controller, read in these external files, process them, then pass the results to the template
20:51 blumbi in tt one can just do '$tt->process('welcome.tt2')'
20:56 ribasushi joined #mojo
20:57 kiwiroy joined #mojo
21:12 kiwiroy joined #mojo
21:16 howitdo joined #mojo
21:17 kiwiroy joined #mojo
21:23 kiwiroy joined #mojo
21:23 marcus-beta joined #mojo
21:24 tchaves joined #mojo
21:30 zach how can you use mojo with no controllers? I don't understand that one at all
21:31 zach vicash: at present, no bots will be consuming this, just a status display update on the progress of the job in the web ui
21:31 Grinnz zach: the Mojo:: modules are largely independently usable
21:31 zach like, doing whatever with this ovf, at this stage of clone, powering up, power up failed, power up was successful, not enough resources,
21:35 jberger Mojo:: is a toolkit of useful modules, gear mainly towards web development, but not entirely
21:35 jberger Mojolicious:: Is a web framework built on Mojo::
22:11 blumbi zach, I wan't to use a template kit to generate some configuration and xml files
22:12 blumbi the files are not served via http, I just need to put them as plain strings to some database and send them via TCP
22:13 blumbi some API intercommunication thing
22:13 blumbi I'am not webapp guy
22:15 Grinnz sounds like it doesn't really matter what template system you use for that component, then
22:15 Grinnz you could use Mojo::Template, Template::Toolkit, or something like Text::Template
22:17 blumbi currently also using IO::Socket
22:17 blumbi but for nonblocking purposes I would like to give the TCP client in Mojo a try as well
22:17 Grinnz i recommend using an event loop (such as Mojo's IOLoop) to handle sockets for you
22:18 Grinnz yes, if you're doing TCP then Mojo::IOLoop::Client is a good choice
22:18 blumbi can I leverage ::Template from Mojo with the use of the TCP client?
22:18 blumbi or is there no gain?
22:20 Grinnz they are unrelated components
22:20 Grinnz you can certainly use both, but they have no bearing on each other
22:21 blumbi ok
22:24 veryrusty joined #mojo
22:36 ccakes joined #mojo
23:00 polettix joined #mojo
23:21 zach how is Mojo::JSON different from other JSON parsers?
23:23 sugar joined #mojo
23:34 haarg it's faster than other PP parsers, but isn't configurable
23:35 Grinnz also, that it's PP (pure-perl)
23:35 Grinnz thus fatpackable
23:35 haarg so you can't use it for "relaxed" decoding for example
23:36 veryrusty joined #mojo
23:52 sugar joined #mojo
23:54 batman joined #mojo

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