Welcome the channel on the development of Cro, a set of libraries for building reactive distributed systems, lovingly crafted to take advantage of all the Raku Programming Language has to offer (cro.services). This channel is being logged for historical purposes.
Set by lizmat on 24 May 2021.
06:14 japhb left 06:21 japhb joined 12:55 patrickb joined
patrickb o/ 12:55
I'm thinking about how to best add FCGI functionality to Cro. I could either cram it into cro-http or have a separate cro-fcgi project depending on cro-http. If craming it into cro-http I could either extend Cro::HTTP::Server to also support FCGI or implement my own Cro::FCGI::Server. 13:02
Can someone offer some advice which route to go?
Altai-man patrickb, 1)I am pretty sure Cro::FCGI is the option, Cro::HTTP is huge already. 2)Subclassing Cro::HTTP::Server::FCGI seems fine to me, though jnthnwrthngtn can have other opinion. 13:27
jnthnwrthngtn Yeah, agree with separate module 14:08
It doesn't to me feel like a natural subclass, unless there's substantial re-use; it may turn out to be better to extract some Cro::HTTP::Endpoint role if there's stuff to share 14:10
patrickb Those answers match my feeling. I think the parts that will end up being shared are the Request and Response classes. 14:55
So simply depending on cro-http and using those classes will probably do. 14:56
btw. has github.com/croservices/cro-http/pull/161 slipped under the radar? 14:57
jnthnwrthngtn Ah yes, I wasn't feeling clever enough to review it at the time you sent it, and then did indeed forget; sorry. 15:10
patrickb Don't worry. I'm not particularly pressed to get that merged, I'd just like for it to not be forgotten. 15:57
18:06 Skarsnik joined
Skarsnik Hello :) Is there a way to have a more 'complete' output from cro?. I am trying to figure why it does not serve a .wasm file as application/wasm x) 18:08
Altai-man Skarsnik, are you aware about CRO_TRACE=1 env var? 18:09
Skarsnik Oh thx :) 18:10
ok, it serves it as application/octet-stream even if I added mime-types => {'multiclient.wasm' => 'application/wasm'}; in my base route ~~ 18:11
Altai-man sounds like a bug, can you open a ticket with a short gist? :) 18:17
Skarsnik Ho, this take the extension
this works fine now ^^ 18:18
Xliff Skarsnik: Are you using 'static' to set the mime type? 18:26
Skarsnik yes
Xliff OK. Sounds like you got it working?
Skarsnik static 'www', @path, :indexes<index.html>, mime-types => {
'wasm' => 'application/wasm'
};
kinda weird that not the proper default thou ^^ 18:27
Xliff Might want to create a module that establishes the proper default and send in a PR or keep it as an external module.
I'm getting "Cannot write to a closed socket" on request I make with PHP. Does anyone have any ideas as to how this might occur? 19:13
19:54 Altai-man left, sena_kun joined
jnthnwrthngtn Skarsnik: Please submit a PR to add it to github.com/croservices/cro-http/bl...eTypes.pm6 20:51
Skarsnik I am confused, I have a simple form with a select box that do a submit on a button. A route post -> 'create-session', :$game! is query {} should work? or the post param are elsewhere? 20:58
jnthnwrthngtn Elsewhere, `is query` is from the query string 21:00
See the router docs, the section about request bodies 21:01
But approximately, `request-body -> (:$game!, *%) { }` inside of your route handler
Skarsnik Hoo thanks 21:02
Geth cro-http: Skarsnik++ created pull request #167:
Added webasm extension to MineType
21:04
cro-http: e2cb05adca | (Sylvain Colinet)++ (committed using GitHub Web editor) | lib/Cro/HTTP/MimeTypes.pm6
Added webasm extension to MineType

So this returns the proper 'application/wasm' type for web assembly file.
21:08
cro-http: c30de763a1 | (Jonathan Worthington)++ (committed using GitHub Web editor) | lib/Cro/HTTP/MimeTypes.pm6
Merge pull request #167 from Skarsnik/patch-1

Added webasm extension to MineType
Skarsnik unrelated, maybe the cro runner could not restart on change on ~ file? eg: (change to /mnt/f/Project/multithingy/server/lib/Multithingy/Routes.rakumod~) 21:15
jnthnwrthngtn Skarsnik: iirc you can add exclude patterns in the .cro.yml 21:18
cro.services/docs/cro-yml#Controll...c_restarts 21:19
Skarsnik Ok, I have a page that create me session of something, redirect me an uuid4 url. that load some js & webasm code. Took me 5h xD 21:23
jnthnwrthngtn, you are working on Comma also? if so, do you think it would be easy to add a support for wsl terminal on the windows release? x) 21:24
jnthnwrthngtn Skarsnik: Does it work if in Settings > Tools > Terminal you set the shell to use wsl.exe? 21:41
Skarsnik oh, this actually work ^^ 21:48
I did not think there was an exe available for this 21:49
this will save me some annoyance, thank :) 21:59