Cro: libraries and tools for building reactive services in Perl 6 | cro.services/ | Logs: irclog.perlgeek.de/cro/
Set by moderator on 15 January 2018.
02:57 ilbot3 joined
moderator Cro: libraries and tools for building reactive services in Perl 6 | cro.services/ | Logs: irclog.perlgeek.de/cro/
11:35 scovit joined
Geth cro-http: 4051032da5 | (Jonathan Worthington)++ | lib/Cro/HTTP/Request.pm6
Add an auth field to Cro::HTTP::Request

This can be used to attach authorization or session information to the request object. Various upcoming features will use it.
11:42
cro-http: eeefdbb5aa | (Jonathan Worthington)++ | 2 files
Add the Cro::HTTP::Auth marker role
11:57
cro-http: 06c11ed060 | (Jonathan Worthington)++ | lib/Cro/HTTP/Router.pm6
Move per-route compilation out to a sub

To try and make the code a little easier to digest.
13:44
cro-http: 8dcf5bce06 | (Jonathan Worthington)++ | lib/Cro/HTTP/Router.pm6
Make a constant a `constant`; scope it tighter
13:48
cro-http: c7aba9267d | (Jonathan Worthington)++ | lib/Cro/HTTP/Router.pm6
Form / Capture correctly in the first place

Rather than having a workaround for it not being correctly fixed up later on.
14:02
cro-http: 59e2eb08de | (Jonathan Worthington)++ | 2 files
Initial router support for auth

This implements the case where a Cro::HTTP::Auth typed parameter is used at the start of the route segment. Note that a delegate is required here for now because the route matcher currently runs ahead of any middleware. That may or may not be something we wish to revisit in the future.
14:26
cro-http: dfe87b4271 | (Jonathan Worthington)++ | 2 files
Implement and test `is auth` trait in router

Which is the second way to indicate that a parameter expects to be populated with the request's auth property.
14:34
cro: 829ae5a50d | (Jonathan Worthington)++ | docs/http-auth-and-sessions.md
Fix auth docs to reflect requirement to `delegate`
14:39
cro-http: 5f26d36c0a | (Jonathan Worthington)++ | 3 files
Implement Cro::HTTP::Session::InMemory

Providing support for in-memory sessions.
16:29
cro: ea39dbd6e3 | (Jonathan Worthington)++ | docs/http-auth-and-sessions.md
Tweak docs on in-memory session

To reflect what was implemented.
16:32
lizmat Question: Cro doesn't do UDP sockets, because Rakudo / MoarVM doesn't, right ? 16:36
this in reference to: stackoverflow.com/questions/482835...rom-server
jnthn Rakudo/MoarVM do UDP sockets 16:38
We don't have any UDP-using stuff in Cro as of yet, though
github.com/perl6/roast/blob/master...sync-UDP.t 16:39
You use the .Supply on either side to read
timotimo that code isn't even sending a response at all? 16:59
lizmat well, maybe the op needs guidance :-) 17:00
timotimo UDP is funny because it doesn't have a concept of connections
so a "reply" isn't as simple as you might think
lizmat right, so you need 2 servers to actually have a response possibility 17:01
timotimo right
though i don't know if you can get the details about who sent you something from the udp socket's supply 17:02
so it looks a bit like unless your protocol explicitly has a return address field you can't do the simple thing in perl6 as of yet? 17:04
jnthn Maybe not.
timotimo it would be necessary to get a supply of sender-address and message tuples
jnthn has never had reason to use UDP as of yet
lizmat jnthn: if you're doing any logging over TCP, then you're doing it wrong: it should be UDP 17:05
timotimo perl5 seems to have $source-address = $socket->recv($data, ., .)
lizmat at former $work, a non-responsive TCP-based logging service brought down the whole site more than once 17:06
jnthn lizmat: If I'm doing distributed logging, I'm usually outsourcing that to something widely used. ;)
lizmat and that will use UDP, no doubt :-) 17:07
timotimo cro currently just outputs logs to stdout/stderr
if you're attached via ssh, that uses tcp :(
lizmat if you need to ssh your logging, you're doing it wrong also :-) well, if you wanna scale :-) 17:08
timotimo of course ;)
jnthn Last time I did that stuff, it was deployed in containers, the stdout/stderr of those was being written to log files by the container infrastructure, and fluentd was collecting/forwarding them :) 17:09
stdout/stderr is a pretty good default for if you're in containers
Or even if you're not, if the 12 factor app thing is to be believed: 12factor.net/logs 17:10
Anyway, that's the reason why Cro does stdout/stderr out of the box: it's good for development, and potentially good for production too 17:11
timotimo i bet it would be fun to build a middleware for cro that tells prometheus some deets on its internal state & health 17:13
all it requires is to have an endpoint that prometheus can scrape via HTTP
we'd call it ... 17:14
Crometheus
hm, it uses either protobuf or plain text ... do we have a library yet ...
lizmat :-)
timotimo doesn't seem like it 17:15
jnthn I don't think you need a library for plain text ;)
protobuf is a big job...I took a look at doing that and...no, I already have too many large tasks :)
timotimo i see, hmpf 17:16
and now that liz made the snapper and telemetry module, maybe i should resurrect vmhealth :) 17:17
lizmat perhaps, but having multi-threaded profiling would also help :-) 17:18
timotimo yup, but vmhealth would only take ten minutes (once a sensible API is decided upon)
jnthn Yeah, lack of that makes optimizing Cro hard :)
timotimo (though of course if it's internal we can change the api around as much as we like) 17:19
Geth cro-http/push-promise: 4 commits pushed by Altai-man++ 17:24
cro-http: 4ecfa28a7a | Altai-man++ | t/router-auth.t
Simplify code
19:18
cro: 639ee73c18 | Altai-man++ | docs/http-auth-and-sessions.md
Fix thinko
19:27