Cro: libraries and tools for building reactive services in Perl 6 | cro.services/ | Logs: irclog.perlgeek.de/cro/
Set by moderator on 30 January 2018.
00:00 japhb joined
colomon another (quick, I hope) cro project, another stupidish question: if I’ve got (say) a JPEG in my cro project directory, how can I link to it from within content? 02:39
colomon can work around by sticking the image somewhere else.... 02:42
02:58 ilbot3 joined
moderator Cro: libraries and tools for building reactive services in Perl 6 | cro.services/ | Logs: irclog.perlgeek.de/cro/
colomon Huh. cro is returning 03:32
📓 monty Listening at 192.168.1.169:20000
⚠ monty Unexplained error
and appears to continue running an older version of script
aha! there was still an instance of service.pl running in the background 03:38
still needs lots of work, but a first stab at it: github.com/colomon/monty 04:17
afk # bedtime 04:18
07:27 SmokeMachine joined 10:49 lizmat joined
Geth cro-websocket: d53f42324a | (Jonathan Worthington)++ | 7 files
Refactor to support body parsers/serializers

These changes get the Cro::WebSocket distribution using the body parser and serializer API now in Cro::Core (generalized from that previously found in Cro::HTTP). We don't yet currently allow for an alternate body parser/serializer to be used at the sugar layer; support for that will be added shortly.
13:04
14:07 colomon_ joined 15:05 sena_kun joined 15:20 Skarsnik joined
japhb colomon: Did you find the answer to your static file question? If not, the tutorial has a good description of serving a single page: cro.services/docs/intro/spa-with-cr...tatic_page and of serving a directory of files: cro.services/docs/intro/spa-with-cr...the_bundle 15:40
jnthn cro.services/docs/reference/cro-htt...ic_content # full docs for static 15:56
Geth cro-websocket: 80de27beaa | (Jonathan Worthington)++ | 7 files
Add body parser/serializer setting in `websocket`

So that you can configure these when using the `websocket` function. This means that you can now get and send messages over a websocket with, for example, a JSON body and not have to deal with that in the handler code.
16:16
cro-websocket: 40d193a379 | (Jonathan Worthington)++ | 2 files
Allow `websocket :json, -> $incoming { ... }`

It's pretty common to speak JSON over a web socket; this does the setup of the body parser and serializer that you could otherwise do manually, but saves the boilerplate.
16:31
jnthn That'll be somewhat convenienter :)
I guess the websocket client wants to get the parser/serializer support too 16:38
And perhaps also :json for consistency 16:39
Skarsnik jnthn, could it work with something like json marshal/unmarshal? to create object directly? 17:10
jnthn Skarsnik: Sure, just write something that does the Cro::BodyParser role and calls whatever JSON marshall/unmarshall you want 17:11
Then install it using the stuff added in the commit prior to the latest one 17:12
Skarsnik I plan to do a Discord module with cro:websocket when I finish my 10 other projects one day x)
jnthn Cool :)
Expcet to ship a release with this new functionality in it later this week or early next 17:13
Skarsnik I think I don't have much work to do
just all the async code to write
I already have code for the API and Discord class
If I understand everything correctly I just expose like a newmessage Supply to the user (so he whenever/react) and in my code I just emit stuff on it? 17:15
jnthn Sounds reasonable (with the caveat I've no real clue what Discord is/does) 17:18
Skarsnik Discord is something like Slack (for the chat/vocal part) 17:19
jnthn Ah, so there's messages going in/out?
Skarsnik yes, per channel/server
jnthn Ah, you're doing the client side? :) OK, I didn't yet complete the custom body parser stuff on the client side yet, but will do it tomorrow :) 17:20
But yeah, then should be quite easy to just plug in the existing parsing etc. that you have 17:21
Skarsnik Don't worry, I already everything written to JSON->my class
btw no circurlar depandancy annoy me x) 17:22
A Discord User has Discord Channel and a Channel has a list of Users x)
18:15 jc_denton1 joined 20:04 Skarsnik_ joined
colomon japhb: does that imply that to serve images, I’d have to do something like 20:19
get -> “static”, $filename { 20:20
static “static/$filename”
}
(serve images to other parts of my cro server, I mean) 20:21
jnthn colomon: I suggest static "static", $filename; for security 22:04
colomon jnthn: …. instead of static “static/$filename” ? 22:38
colomon wonders how he missed the “someone is talking to you alert” for the last 30 minutes, all spent sitting at the computer. :\\
jnthn colomon: Yeah; the two-arg form uses Path::SecureChild or whatever the module is called to take the first as the path to not allow traversal above 22:42
colomon sweet! jnthn++ 22:43