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

IRC log for #mojo, 2018-01-30

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

All times shown according to UTC.

Time Nick Message
00:25 Leffe joined #mojo
00:51 dikim joined #mojo
02:46 epiphero joined #mojo
02:57 ilbot2 joined #mojo
02:57 Topic for #mojo is now 🍩 nom nom | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
02:59 mohawk "race" is also the JS standard method name
02:59 purl okay, mohawk.
03:03 epiphero mohawk: race will reject on the first rejection, while any would only reject if all promises rejected.  It's basically all but with the resolve / reject semantics reversed.
03:09 mohawk and you need this because...?
03:10 aborazmeh joined #mojo
03:13 epiphero I have a list of requests, I'm happy with any successful results, but just because one fails, I don't want to give up on the others.
03:15 mohawk huh, that's tricky
03:15 mohawk i'm trying to think of a way to do that with catch etc
03:16 mohawk you could cheat by converting a reject into a long-term delay, then race would work
03:17 Grinnz Future has that variant fwiw, I think it would be reasonable to add if there's a use case
03:17 Grinnz but it's not up to me :)
03:17 mohawk you could even get truly stupid, and literally just invert your resolves and rejects
03:17 epiphero The hacky way to do it: https://github.com/m0ppers/promise-any/blob/master/index.js
03:18 mohawk so you'd die on a success, and resolve (using catch) on a failure
03:18 mohawk and use race
03:19 mohawk ah, that's sort of what that JS is doing
03:19 mohawk though "reverse" is a poor name, and "invert" would be better
03:19 epiphero mohawk: haha, yes, that's my hacky link above, which is pretty much what I'd do if it's not wanted in the Promise package, but I'd be happy to contribute a normal version if it's wanted.
03:20 epiphero Just mirroring all: http://mibpaste.com/zgEsk4
03:32 mohawk "invalid link"
03:33 epiphero **sigh**
03:34 epiphero https://pastebin.com/hwLg3jJQ
03:34 Repaster Repasted text from epiphero: https://perl.bot/p/v6xozi
03:39 mohawk my only comment would be that this can't handle non-promises
03:42 mohawk and you could short-cut that nicely by just grepping for those and resolving first one immediately
03:45 Afristar_ joined #mojo
03:46 epiphero Good point on the short-circuit.  I'm looking at https://github.com/kraih/mojo/pull/1177 now ...
04:09 epiphero mohawk: https://pastebin.com/RgYMg9AM
04:09 Repaster Repasted text from epiphero: https://perl.bot/p/vos76f
04:11 mohawk since it's a new method, you could make it class-only for now, like "all" is (bar deprecation)
04:11 mohawk therefore avoid the _clone
04:11 mohawk i don't understand the "! @_"?
04:12 mohawk oh, you just meant $_
04:13 mohawk otherwise, looks fine to me. you'd need docs + tests
04:13 mohawk bear in mind i have yet to have a PR merged! so my opinion should be weighted according
04:13 mohawk ly
04:18 epiphero oops, yes, typo, just a scratchpad.  Happy to add docs & tests ... just trying to get a feel for good / bad idea.  There is a whole rabbit-hole of possibilities beyond "any" (http://bluebirdjs.com/docs/api-reference.html) and we should probably stop somewhere.
04:18 mohawk quite
04:19 mohawk well, sri would be the arbiter
04:25 mohawk i know of their "props" method, which is quite clever
04:31 mib_t2dro5 joined #mojo
05:04 dboehmer joined #mojo
05:10 Leffe joined #mojo
05:32 itaipu joined #mojo
06:33 trone joined #mojo
06:56 polettix joined #mojo
07:03 tyldis So the Mojo::IOLoop->timer seems reasonably stable, also many hours into the future. At least on libev. I suspect the only thing that could throw it off is if there is a vast amount of events hitting concurrently?
07:11 McA joined #mojo
07:15 McA joined #mojo
07:15 dod joined #mojo
07:23 Vandal joined #mojo
07:25 inokenty-w joined #mojo
07:26 McA joined #mojo
07:35 Leffe joined #mojo
07:40 AndrewIsh joined #mojo
07:41 noganex joined #mojo
08:00 McA joined #mojo
08:09 trone joined #mojo
08:09 polettix joined #mojo
08:14 dod joined #mojo
08:24 bianca joined #mojo
08:33 seba joined #mojo
08:38 seba mishanti1: hi, r u online?
09:08 jamesaxl joined #mojo
09:10 Jonis seba: he's in a meeting
09:10 Jonis I'll let him know you're looking for him when he's finished
09:12 seba ok, nothing urgent
09:47 sri epiphero: i'm not particularly keen on adding more stuff to Mojo::Promise for now, since it's still so new
09:50 sri think a method that's not part of standard js promises would require overwhelming interest from the community
09:50 sri maybe make it a role for now
10:15 raMBo joined #mojo
10:16 diegok epiphero: I can see this any() thing useful and would love to use it as a role :-)
10:17 mishanti1 seba: Yeah. Was afk for a while, but here now.
10:19 seba mishanti1: hi, sorry for the delay in PR#23 but I was "off-grid" lately
10:20 mishanti1 seba: No worries. :) People usually have lives to attend to.
10:20 seba and back to question You've asked I'm still wondering what to do with this API
10:21 seba as sri discourages using ->wait inside methods, publisher needs some attention to
10:21 seba maybe drop 'blocking' methods and write in docs that one can always use ->wait on promise methods
10:22 sri not just discourages, i'm saying "don't do it!" :)
10:22 seba :)
10:22 mishanti1 Hehe
10:22 seba so maybe just Mojo::RabbitMQ::Client::Consumer->consume_p()->wait
10:22 sri seba: not quite true though, ->wait only does something if the event loop is not running yet
10:22 sri inside a mojo web server for example ->wait never does anything
10:23 seba Mojo::RabbitMQ::Client::Publisher->publish_p()
10:23 mishanti1 I used the promise-based Publisher and honestly had no need for the start()-method that called wait() for me. The pure promised-based one is the way to go I think.
10:24 mishanti1 So publish_p() yes.
10:24 seba so this two will be promise only - and it's fine with me
10:25 seba about Consumer, which one you think we should use ->start_p, or ->consume_p?
10:25 mishanti1 consume_p, for consistency
10:26 sri consume_p sounds consistent
10:26 seba I think so too, so consume_p it is
10:26 mishanti1 seba: I can amend the PR later today if you want?
10:27 seba mishanti1: ok
10:27 mishanti1 Though there still the issue of the tests randomly failing when run through travis. Had a chance to look at that?
10:27 seba I'll drop ->publish in Publisher and stick with ->publisher_p in docs
10:29 seba mishanti1: about that, its hard to tell - it fails randomly saying that it receives something invalid from RabbitMQ server
10:30 seba for now I'm just adding additional layers of debug output to this test
10:31 sri seba: that means you're not breaking the openqa plugin, right? https://github.com/os-autoinst/openQA/blob/master/lib/OpenQA/WebAPI/Plugin/AMQP.pm
10:33 seba sri: no, as far as I can tell every change we've made so far is backward compatible, and this test I'm writing about currently has nothing to do with API code - I was just trying to do some online RabbitMQ server tests with travis
10:33 sri great
10:34 sri guess you can do whatever you want with publisher and comsumer, since they were kinda borked anyway
10:42 seba in openQA you use pure client, so nothing revolutionary happened there ;)
10:42 seba mishanti1: I've just forced this failing test to pass, so rebase to lastest master and your PR should pass
10:50 seba yet it still fails due too some timeout in one case :(
10:53 Lee joined #mojo
11:02 seba I just had to disable this test completely, now it's clean
11:04 mishanti1 seba: I had the whole test-suite running in while-loops on multiple versions on Perl here. Could not reproduce any failures last time I ran them, so I'm pointing a finger at Travis until someone has a better theory. :p
11:07 seba I'm to pointing this at Travis too, fails were random, mostly due to invalid response from server - but it is very hard to diagnose them without polluting commit history and adding ever new `diag` statements ;)
11:12 tchaves joined #mojo
11:24 raMBo joined #mojo
11:34 itaipu joined #mojo
11:41 bianca joined #mojo
11:46 Leffe joined #mojo
11:59 dotan_convos epiphero, mohawk - I think this could be used for "resolve all promises, skip rejections" - https://irclog.perlgeek.de/mojo/2017-11-15#i_15451549
12:00 dotan_convos (or it could when I tried it, back in November)
12:11 sri heh, yea, that should work
12:11 raMBo joined #mojo
12:12 coolo sri: just disovered in a chromium backtrace:
12:12 coolo #8 0x55d9761f22a7 mojo::InterfaceEndpointClient::NotifyError()
12:12 coolo who would have thought they support mojo natively :)
12:14 Edward joined #mojo
12:14 sri :)
12:14 sri that's a weird find
12:14 sri https://chromium.googlesource.com/chromium/src/+/master/mojo/README.md
12:16 coolo mojo bindings for C++ sound like my wet dreams though
12:20 raMBo joined #mojo
12:23 tcohen joined #mojo
12:24 raMBo joined #mojo
12:26 raMBo joined #mojo
12:26 exp-innit coolo: libperl not do you? :)
12:32 bianca joined #mojo
12:46 tcohen joined #mojo
12:52 exp-innit have a possibly dumb question, i'm making a login request with Mojo::UserAgent, storing the returned cookie in the session, and then if i detect that named cookie in the session, restore it and make the request regardless
12:52 exp-innit i'm parsing the inbound cookie with my $cookies = Mojo::Cookie::Response->parse($cookie); and the object it produces appears identical to the one returned by the login
12:53 exp-innit i'm setting it in the exact same way each time too, $ua->cookie_jar->add($cookies->[0]); vs $ua->cookie_jar->add($cookie); (and pping both of those indicates they are identical)
12:54 exp-innit is this expected to give identical behaviour? if so it must be something else the upstream is setting/doing i assume
12:58 * exp-innit afks for lunch
13:10 pirateFinn joined #mojo
13:23 tyldis ravis fails randomly on my tests on other projects too. Redo the same pipeline and it works.
13:36 mishanti1 Yeah, I'm seeing those random-fails as a somewhat "consistent" behaviour of Travis. Though, it is easy to be fooled and not discover actual faults in own test-implementation.
13:37 hkclark_ joined #mojo
13:37 mishanti1 "Wolf, wolf" and all that.
14:00 Ya_ALLAH_Ya_Muhmd joined #mojo
14:00 Ya_ALLAH_Ya_Muhmd left #mojo
14:03 Leffe joined #mojo
14:06 aborazmeh joined #mojo
14:07 Leffe joined #mojo
14:07 bianca joined #mojo
14:13 jamesaxl exp-innit: try with a simple example using Mojo::UserAgent::CookieJar
14:13 jamesaxl exp-innit: https://metacpan.org/pod/Mojo::UserAgent::CookieJar
14:13 exp-innit jamesaxl: i'm confused, that is what i am doing :)
14:14 exp-innit i login, retrieve cookies from response, set them with $ua->cookie_jar->add
14:14 gizmomathboy joined #mojo
14:14 exp-innit when the user refreshes the page, i extract the cookie from their session, and use the same method with an identical object afaik
14:14 exp-innit i'm assuming that the cookie_jar command isn't actually causing them to be used in the req or similar, i'll tcpdump it (Easiest option eh)
14:16 exp-innit or not as the whole path is SSL of course :)
14:18 jamesaxl exp-innit: I wonder what is $ua that you are assign ? cookies in mojo is very simple my $cookie = Mojo::Cookie::Response->new; and you can set what you need
14:18 jamesaxl exp-innit: could you pastebin ?
14:18 exp-innit jamesaxl: right i tested it without the cookie_jar line, that's indeed the case
14:19 exp-innit jamesaxl: i can, give me a few moments
14:20 ranguard hmm, oddity with JSON::Validator not requiring a YAML parser but throws warning about not being able to call 'can()' on it - JSON/Validator.pm line 243 - not really sure where the issue should actually be reported, but thought I'd mention here... Installing YAML::XS fixes it
14:21 exp-innit ranguard: https://github.com/jhthorsen/json-validator/issues i would assume
14:21 exp-innit seems there was a YAML related patch just over a week ago
14:22 exp-innit https://github.com/jhthorsen/json-validator/blob/master/lib/JSON/Validator.pm#L243 it is as you suspect
14:22 ranguard well, not sure it's actually json validators issue or Mojolicious::Plugin::OpenAPI or $user for deciding to use YAML and not JSON :)
14:22 Leffe joined #mojo
14:22 exp-innit ranguard: specifically: https://github.com/jhthorsen/json-validator/blob/master/lib/JSON/Validator.pm#L973
14:22 ranguard I guess I'll open an issue more as an FYI on there... thaknks
14:23 ranguard ahh, ok, yea that line should do something better :)
14:23 ranguard exp-innit: thanks
14:26 batman ranguard: you can ask in #swagger
14:26 * batman is the author
14:27 epiphero left #mojo
14:27 ranguard batman: thanks
14:27 epiphero joined #mojo
14:29 exp-innit ok, so related to my problem
14:29 exp-innit $ua->cookie_jar->add(whatever) is not enough by itself to cause the cookie to be included in the request
14:29 exp-innit i'm not sure why
14:30 exp-innit i can strip this code down and pastebin it shortly, but not sure that's required
14:30 exp-innit i'm probably just missing something dumb, to google!
14:32 epiphero sri: thanks for the feedback.
14:32 epiphero What's the current thinking on the Mojo::Promise::all  and ... ::race instance method deprecation?  I see PR 1179 proposes un-deprecating them, but if they aren't going to be instance methods, wouldn’t a subclass / Mojo::Promise::More package make more sense than a role?
14:38 exp-innit so where i'm at currently: i'm calling cookie_jar->add, but what i add to it does not get returned from ->all
14:39 exp-innit specifically, i wonder if https://metacpan.org/source/SRI/Mojolicious-7.61/lib/Mojo/UserAgent/CookieJar.pm#L26 is at issue
14:39 exp-innit given this has no domain set whatsoever, not even a 0 length string
14:40 exp-innit trying to double check that now
14:44 exp-innit that is as far as i can tell, the proximate cause
14:45 exp-innit by-eye that code should pass though right? as $origin will be ''
14:47 epiphero exp-innit: But '' is false, so no origin or domain -> next
14:47 bianca joined #mojo
14:48 exp-innit epiphero: i always forget what's truthy/falsey in 5, or perl in general
14:48 exp-innit too many languages
14:48 exp-innit anyhow this seems a bug to me? running it through the debugger now to check
14:49 exp-innit i can at least confirm that the serving software upstream does not set any domain, just a path
14:50 exp-innit so i guess the issue here is that dumping the cookies from the response does not implicitly set the domain to the current domain, which sounds like it's 'required' by the spec
14:55 exp-innit yeah section 5.3.4 of RFC 6265 permits 'the empty string' in a domain
14:55 exp-innit from what i can tell, everything in mojo here is technically correct
14:56 exp-innit which is frustrating as this is an ugly hole in the spec
14:58 exp-innit I suppose the only oddness here is that the UA has some logic somewhere to keep this cookie in the jar and assigned to the current domain, even though it won't include that in to_string
14:58 exp-innit so i'd argue that's a bit of a wart, but i don't think there's any good solution for it
15:06 mtths joined #mojo
15:07 exp-innit ok, so on some further reading, RFC 6265 section 5.3.6 states this cookie should be rewritten
15:07 exp-innit specifically: `Set the cookie's domain to the canonicalized request-host`
15:07 exp-innit which does not appear to be done by Mojo::UserAgent that I can tell
15:08 exp-innit https://metacpan.org/source/SRI/Mojolicious-7.61/lib/Mojo/Cookie/Response.pm#L45
15:20 exp-innit right issue filed: https://github.com/kraih/mojo/issues/1185
15:20 exp-innit I look forward to finding out just how wrong I am :)
15:31 hesco1 I have a route: ->to(some_controller#action); the ->action method then routes the request like so: $self->$action( $aup_component ); The logs then advise me:    [debug] Routing to controller "..." and action "copy"
15:31 hesco1 p  n
15:32 Leffe joined #mojo
15:35 hesco1 co
15:36 hesco1 Is this expected behavior?
15:37 bianca joined #mojo
15:37 hesco1 the value of $action is 'copy', the routing is correct.  what surprised me was that the logs were able to keep up and let me know how my request is being handled without me having to explicitly ask it to.
15:41 seba joined #mojo
15:46 Pyritic joined #mojo
15:53 sh14 joined #mojo
15:55 ChmEarl joined #mojo
15:57 Leffe joined #mojo
16:00 tyldis I assume there is no builtin way of having state across hypnotoad workers? I would have to resort to some homegrown backend?
16:00 exp-innit tyldis: I asked that yesterday, the answer was as you suspect
16:01 exp-innit you can store data in the user's session cookie if that is enough
16:01 tyldis In this it's not session related
16:02 tyldis I have a plugin for Prometheus that gives you metrics on all http requests. But apprently under hypnotoad it doesn't aggregate the stats
16:04 tyldis Is there a way to detect that we are indeed running under hypnotoad?
16:09 bianca joined #mojo
16:12 disputin joined #mojo
16:37 pink_mist tyldis: if the state is immutable you can just put it in the config, otherwise use a backend DB or message broker such as Mojo::Pg or Redis2
16:39 Ya_ALLAH_Ya_Muhmd_ joined #mojo
16:39 Ya_ALLAH_Ya_Muhmd_ left #mojo
16:53 sri tyldis: it's called a database :p
16:54 tyldis Total overkill in order to count the number of 404s...
16:54 sri most people use redis like that, a global namespace for variables shared by multiple servers
16:55 sri that's actually relevant to a plugin we want for mojolicious
16:56 sri for ages we wanted a plugin that stores all sorts of stats in shared memory
16:57 tyldis IPC::Sharable or something more clever?
16:57 sri i'm not sure which shared memory module is trendy at the moment
16:59 sri stats to shared memory and a template under /stats or so to display all the data
16:59 purl Since Wed Jan 24 15:25:48 2018, there have been 191 modifications and 28 questions.  I have been awake for 6 days, 1 hour, 33 minutes, 14 seconds this session, and currently reference 991804 factoids. Addressing is in optional mode.
16:59 exp-innit sri: re: https://github.com/kraih/mojo/issues/1185 i'm heading off in about 30 mins, so if there's anything I can do to make it clearer etc please let me know.
16:59 sri (like the minion admin)
16:59 exp-innit I edited the original issue to tidy it up a bit, but I'm bad at explaining issues it seems
16:59 tyldis Looked briefly at it, but had performance caveat
16:59 sri exp-innit: doesn't really make it much clearer for me
16:59 tyldis (IPC::Storable)
17:00 exp-innit sri: `Mojo::Cookie::Response should not accept blank Domain but should set to request-host` a better summary?
17:01 sri exp-innit: does Mojo::UserAgent::CookieJar reject cookies it should accept?
17:01 exp-innit sri: I don't believe so, cookies with a blank domain are invalid at that point
17:01 exp-innit so rejecting them seems the correct option
17:02 sri so, what is Mojo::UserAgent::CookieJar doing wrong?
17:02 sri are cookies sent back out that shouldn't?
17:02 sri please be precise
17:03 sri what is "Mojo::Cookie::Response passes back Domain unmodified..."?
17:03 exp-innit sri: yes, cookies are returned with a blank 'Domain' parameter, yet the RFC states that if blank, this parameter should be set to the request-host
17:03 sri returned where?
17:04 exp-innit from both the UserAgent::CookieJar and from Cookie::Response->to_string
17:04 sri to the user?
17:05 exp-innit yes (although maybe you mean something different by user)
17:05 sri we are not the cookie police, we don't validate all data presented to the user
17:05 exp-innit sri: this is a MUST in the RFC so it's not really about validation
17:05 sri or even fix it, that's way out of scope
17:05 exp-innit there's something internal that's making this work too, let me try and explain that a bit more verbosely
17:05 sri maybe i'm still not understanding you
17:05 exp-innit if I make a UA request to /login, it returns a cookie without a Domain parameter, if I make subsequent requests with that UA to endpoints, it correctly includes this cookie
17:06 exp-innit if however, I serialise this cookie, instantiate a new UA and load this cookie, it is serialised with a blank 'domain' parameter, and so is invalid for all domains
17:06 exp-innit (/login being an internal endpoint on an internal service etc)
17:07 sri yea, that's not a bug, you want a new feature
17:07 exp-innit i disagree, the RFC has a MUST section with this parameter
17:07 exp-innit and so storing the cookie with a blank Domain parameter violates this
17:08 exp-innit the cookie that I retrieve from the jar is not the same cookie as UA is using internally, as the blank Domain parameter would otherwise prevent this
17:08 exp-innit sri: tomorrow I will nail down exactly where that is happening so I can be more clear
17:08 exp-innit apologies for any confusion so far
17:08 sri maybe it would help to include more people in the discussion, i'll step back from it for now
17:09 exp-innit roger, specifically the section I take issue with is RFC 6265 Section 5.3 Bullet Point 6, which (summarised) says 'the user agent MUST...Set the cookie's domain to the canonicalized request-host'
17:10 exp-innit this is clearly happening internally somewhere within Mojo::UserAgent, so my task next is to find this :)
17:11 mohawk dotan_convos, that was my first thought when epiphero suggested it, but it doesn't solve the problem of "resolve immediately and i don't care about the rest"
17:12 mohawk ie it still waits for the others
17:12 sri exp-innit: perhaps the explanation does require code to be understood
17:13 dod joined #mojo
17:15 exp-innit sri: I have discovered recently just how bad I am at explaining issues, so it's almost certainly my fault, and I'm happy to produce a test case
17:15 CandyAngel exp-innit: Are you including the origin in your serialisation?
17:15 CandyAngel CJ uses that if the domain is empty
17:15 exp-innit CandyAngel: I'm not sure what you're asking, I'm using Mojo::Cookie::Response's to_string method
17:16 sri to_string is not proper serialization, there's data excluded
17:17 exp-innit in this case I don't think it's affecting anything, as I also dump the Data::Dump equivalent of the cookie, and there are no parameters there not included in the to_string version
17:17 CandyAngel exp-innit: I had to handle empty domains for my persistent cookiejar
17:17 exp-innit but I'll make a note of that sri
17:18 sri CandyAngel made a role for persistent cookie jars, so she's very familiar with the internals
17:18 CandyAngel "very"
17:19 CandyAngel exp-innit: https://github.com/CandyAngel/perl-mojo-useragent-cookiejar-role-persistent/blob/master/lib/Mojo/UserAgent/CookieJar/Role/Persistent.pm#L43
17:20 exp-innit CandyAngel: that looks like the same behaviour, but according to the RFC this should occur on storage, and so retrieving this cookie from the UA should include the set Domain parameter (IMHO)
17:20 CandyAngel Seems odd that the RFC would define what happens with internal implementation..
17:21 exp-innit I think once you retrieve the cookie from the UA that's no longer internal?
17:21 exp-innit the alternate view of this bug is: I can copy that cookie between UAs and their behaviour will differ
17:21 exp-innit which is an inconsistency
17:22 CandyAngel But you're not copying the cookie
17:22 exp-innit I was prior to this attempt, and I was seeing the same behaviour (the new UA's cookiejar->all method returned no cookies)
17:22 exp-innit (as it skips any with a blank domain in ->add)
17:23 CandyAngel If there is no ->domain or ->origin, yeah
17:23 CandyAngel Are you providing origin?
17:23 exp-innit I'm not sure how I would provide it, this cookie is generated through a UA POST
17:24 CandyAngel I mean when you are loading it into the other UA
17:24 exp-innit no, I have no way of knowing what its upstream URI was at that point
17:24 disputin joined #mojo
17:24 CandyAngel If you are fully copying the cookie, it'll be in $cookie->origin
17:25 CandyAngel So you need to do.. $jar->add(Mojo::Cookie->new(origin => ..., ...)) to load it in "the same"
17:25 Grinnz tyldis: redis is never overkill :)
17:26 Grinnz it's the easiest server to set up, and namespaces are entirely up to your app on the fly
17:26 Grinnz no schemas
17:26 exp-innit CandyAngel: I don't remember that being extant, but the logs have since scrolled off my page, let me repeat the test before I leave
17:26 Grinnz ideal if you quickly need a pubsub broker or shared cache
17:27 exp-innit CandyAngel: would you mind if I PMd?
17:27 CandyAngel Go ahead
17:29 bianca joined #mojo
17:31 sri oh, altered carbon will be on netflix this week \o/
17:31 mohawk Grinnz, sorry if this is a dumb question: does redis have a notification feature? (you mentioned pubsub)
17:32 Grinnz it has pubsub... if that's what you mean?
17:33 sri redis has all the features :)
17:34 sri it's crazy how big this list got https://redis.io/commands
17:36 exp-innit redis has all the features apart from scaling :(
17:38 Grinnz i assumed scaling is what all that cluster stuff was for
17:38 sri it's not great
17:39 sri they made the client responsible for managing the whole scaling thing
17:39 exp-innit Grinnz: if you can survive with eventual consistency
17:39 sri so....
17:39 exp-innit there are many many options, including Redis
17:39 exp-innit if you plan to run more than one server you will need some sort of implementation of RAFT
17:39 exp-innit or equivalent consensus protocol
17:39 Grinnz mm
17:41 tyldis Requiring redis to be able to have metrics is not an option... Abusing network broadcasts seems like an even better idea for shared memory ;)
17:42 mohawk Grinnz, i did not know that
18:04 tyldis Hmm, zmq might be an option
18:07 Grinnz tyldis: why would that be an option if redis isn't?
18:07 tyldis Zmq doesn't require a dæmon
18:08 tyldis But might be more portable than Unix sockets?
18:13 tyldis I want as little friction as possible for the devs. No need to know anything about infrastructure for things like log aggregation and metrics
18:14 Grinnz never used zmq; didn't know it was daemonless
18:17 tyldis Brokerless they say
18:17 hahainternet joined #mojo
18:19 hahainternet sri: so CandyAngel was amazingly helpful, and helped me find a bug in my code, which although it did not resolve the issue, helped me locate more precisely where it was
18:19 hahainternet i'll do my best to provide you with a good example and links to where i believe it disagrees with the RFC tomorrow
18:20 jamesaxl I like redis a lot now
18:20 disputin joined #mojo
18:21 dotan_convos mohawk: I guessed there might be some extra requirement. Couldn't you use a similar trick (use  catch() to avoid the rejections aborting) together with race() to create any()?
18:22 trone joined #mojo
18:25 dotan_convos Although fiddling with that I get a warning about "destroying object with 1 non-received or timed out results during global destruction."  I assume that's a dangling closure from a promise or the Mojo::UserAgent.
18:29 seba joined #mojo
18:31 AndrewIsh joined #mojo
18:31 Leffe joined #mojo
18:31 mohawk dotan_convos, see our conversation from earlier. the semantics sought by epiphero is the exact converse of "all", and can be achieved by switching all resolves to reject, vice versa, and using "all"
18:31 mohawk and only by that
18:38 Afristar_ joined #mojo
19:40 Seth joined #mojo
19:40 mishanti1 What is the elegant way to get rid of that "Server available at..."-log message when starting an app with hypnotoad?
19:41 mishanti1 Basically I think I need to be able to have my application and hypnotoad have different setup for logging OR have the server (hypnotoad/prefork) use the same logger as my application.
19:41 mishanti1 The latter so that hypnotoad also logs in the same format as my application does.
19:42 pink_mist is there any example of a plugin that hooks into the Mojo::IOLoop to wait on filehandles? I'm not quite sure how to go about this
19:42 mishanti1 Currently I use Mojo::Log::JSON, and that works like a charm, but there is still that one line of output when starting the server, and that breaks the expectation of "only json is logged".
19:43 sri mishanti1: i suppose that should be a debug log message, not info
19:44 mishanti1 sri: Yeah, that would be my expectation as well.
19:45 sri hmm, although, there are many more info log messages in ::Prefork
19:47 mishanti1 Well, there are a couple yes. It seems to me one could argue that all (those that are currently at info()) should either be info or all be debug().
19:47 mishanti1 ..since they are similar-ish / of the same class message.
19:48 sri i'm open to changin them if there are enough votes
19:48 sri open an isse with the proposal
19:52 dod joined #mojo
20:04 mishanti1 Sure. :) But before I do it would be nice with a short sanity check. When running hypnotoad in the foreground (in docker) hypnotoad logs one line to STDOUT, the rest goes to STDERR, including application logs.
20:05 mishanti1 The one line going to STDOUT seem unaffected by what kind of logger is set in the application, while all the "worker has .."-messages honor the defined logger. My issue is demonstrated in the output here: https://pastebin.com/jiBmYRjn
20:05 Repaster Repasted text from mishanti1: https://perl.bot/p/1ii5f3
20:06 mishanti1 Line 2 is the only one going to STDOUT. Verified by running with 2>/dev/null, and the reverse hiding it by 1>/dev/null.
20:07 mishanti1 Hope I am explaining things somewhat clearly.
20:08 pink_mist I mean, it doesn't seem like the io watcher actually fires if I do Mojo::IOLoop->singleton->reactor->io($fh => sub { ... }); in the register sub of my plugin ... is the Mojo::IOLoop->singleton the right thing to use there? does the $app have an ioloop I should be using instead?
20:10 pink_mist hmm, let me check if I simply need to flush the write
20:10 pink_mist ok, yes, that does seem to have done the trick :P
20:13 tyldis Well, asking in #perl about the shared memory with hypnotoad went pretty south. At least I know I stupid and insane. Blame my self for taking the troll bait.
20:14 tyldis Not a complete loss.
20:14 mishanti1 tyldis: Classic #perl eh?
20:17 tyldis I let myself drag into a meta discussion about monitoring, instead of keeping it on topic. Oh well!
20:17 tyldis Off to excercise!
20:22 mohawk always a bad move
20:22 mohawk (see what i did there)
21:02 Pyritic joined #mojo
21:06 Leffe joined #mojo
21:25 sri you'd think writing a mod_status-ish plugin for mojo would be a more common exercise
21:26 sri guess it would be nice if it did html and json
21:26 pink_mist https://nakedsecurity.sophos.com/2018/01/30/bitcoin-exchange-robbed-by-real-life-bank-robbers-with-real-life-guns/
21:30 Grinnz mishanti1: i think the difference is that the "Server available" message isn't a log message, but a product of the command starting the daemon
21:30 Grinnz iow it's not meant for the logfile, it's meant as a response to whoever initiated the server
21:31 Grinnz but i could be wrong
21:39 sri hmm, redhat bought coreos
21:44 polettix joined #mojo
21:46 sri interesting that they are killing container linux, guess they just wanted the kubernetes parts
21:59 marcus acquihire?
22:04 polettix hi all
22:05 polettix I would propose the addition of a small section about Reverse Proxy in the Cookbook, anyone thinks it can be useful? https://github.com/polettix/mojo/blob/patch/doc-reverse-proxy/lib/Mojolicious/Guides/Cookbook.pod#reverse-proxy
22:09 pink_mist there already are at least two sections about reverse proxy in the cookbook?
22:09 Grinnz not specifically how to leverage it from the mojo side, which this looks to be about
22:10 pink_mist I suppose that's a good addition
22:17 sri some of the information seems useful, but it doesn't read so well
22:19 sri it's not good as its own section
22:19 polettix sri: better as a page in the wiki maybe?
22:20 polettix my itch is that searching (in Google at least) for “mojolicious reverse proxy” does not provide good information
22:21 polettix “in Google” => “in my Google bubble”
22:21 polettix a plugin keeps popping up when it’s so dead simple really
22:21 mib_zr8c4n joined #mojo
22:22 sri i mean, if you really wanted to try hard you could write something about how reverse proxys work in the concept section :)
22:23 sri if it includes http protocol examples showing how headers and request line get translated it might actually be interesting
22:24 sri would have been straight to the point though, as to not get too tldr
22:24 sri s/been/to be/
22:24 polettix oh I see, like after “Event loops”
22:24 sri it's kinda hard to get right, but could be pretty cool
22:25 * sri nods
22:25 polettix I’ll give it a try, thanks for the hint
22:25 sri start-line and header translation by reverse proxy is always a little bump in the learning curve for people
22:27 sri we have the kind of concept sections in other guides already
22:27 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Growing#Sessions
22:28 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Routing#Dispatcher
22:47 Leffe joined #mojo
23:04 kiwiroy joined #mojo
23:05 disputin joined #mojo
23:29 kiwiroy What has happened to http://irclog.mojolicious.org - I only see a blank page.
23:30 bianca joined #mojo
23:31 Leffe joined #mojo
23:31 Grinnz works for me... it's supposed to redirect to https://irclog.perlgeek.de/mojo/2018-01-30
23:31 seba joined #mojo
23:31 Grinnz or more generally https://irclog.perlgeek.de/mojo/today
23:32 kiwiroy @Grinnz thanks - that works as expected.
23:35 polettix a first try: https://github.com/polettix/mojo/blob/patch/doc-reverse-proxy/lib/Mojolicious/Guides/Cookbook.pod#reverse-proxy

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