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. |
|||
04:36
CIAvash joined
04:48
CIAvash left
05:26
rypervenche left
10:09
Xliff joined
|
|||
Xliff | jnthnwrthngtn: Hey there! I hope things are going well with you. | 10:10 | |
What would be the best way to introspect the defined routes. | |||
If defined, what would be the best way to turn them off? | 10:11 | ||
10:43
Xliff left
13:22
Xliff joined
|
|||
Xliff | OK, so a routes() sub returns a Cro::HTTP::Router::RouteSet class, which has @.handlers. | 13:39 | |
That has a .implementation, which I guess could be wrapped to execute not-found() if I want them off. | 13:40 | ||
If I want to turn them back off, they can be .unwrap 'd | |||
That sound about right? | |||
15:50
Geth left
15:51
Geth joined
15:52
andinus left
15:53
andinus` joined
|
|||
lizmat | does this ring a bell: | 16:04 | |
Failed to resolve host name 'www.cpan.org' with family 0 | |||
Error: nodename nor servname provided, or not known | 16:05 | ||
in Cro::TCP line 106 | |||
this is on MacOS Mojave | |||
works fine on my own MacOS Mojave, but not on the other machine | |||
Xliff | Wish I could help, but my Mac Mini is currently out of operation. | 16:38 | |
jnthnwrthngtn | Xliff: That's barely API, tbh. Why don't you just use `around` and have it check a flag somewhere? | 16:39 | |
And then give not-found if the flag is set, and call the original route otherwise | |||
Or do it with `before` middleware or something | |||
Xliff | jnthnwrthngtn: That was also a thought, yes. | 16:43 | |
Still need to write up the mechanism that links signature to UI element to handle this. | |||
Also, I was doing this in preparation of allowing a user to reload a route. | |||
AKA in case of uninstall/install for code changes. | 16:44 | ||
Yes, it's definitely better to restart the server for stability, but some people like that kinda thing. | |||
Many expect it. | |||
18:36
xinming left
18:39
xinming joined
18:51
AlexDaniel joined
|
|||
Xliff | Hmmm... crafter an activate/deactivate mechanism at the Cro::HTTP::Router::RouteSet level | 18:52 | |
18:52
CIAvash joined
|
|||
Xliff | Works nice. | 18:52 | |
19:19
AlexDaniel left
19:23
CIAvash left
|