At this stage - not looking for anything particularly exotic - a couple of hello worlds plus a bit o

At this stage - not looking for anything particularly exotic - a couple of hello worlds plus a bit of branched logic using KV store would suffice for now... just to understand how the capn proto config maps to workerd. Also, I'm unclear how workerd routes incoming requests to specific requests. The cap 'n proto example configs in the gh repo are all about binding to an ip:port whereas inbound requests to workerd are pretty much only going to be distinguishable based on their URI or URI path. I did not see anything about routing or pathnames in the schema - however I may have missed something.
12 Replies
jack
jackOP11mo ago
In an ideal world - wrangler could be coaxed into generating some output code + a capn proto config file. I do not want to use wranlger dev for production - as I'm not sure exactly what features it's enabling/disabling to facilitate a good developer experience. Perhaps miniflare is the right way to go, but my understanding is this has now been superseded by workerd. Apologies if my question is dumb - but while so much of CF's documentation is pretty decent - the workerd (admittedly in beta) stuff is opaque - to me at least.
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
kian
kian10mo ago
You'd have to restart workerd with the new capnp config It'll terminate gracefully (i.e let inflight requests be processed) so you launch a new process, move new traffic to that one and kill the old one
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
kian
kian10mo ago
You can create the capnp config programmatically with the capnproto libraries for a given language which should make it easier
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
kian
kian10mo ago
bun
bun10mo ago
can you use cache api as a key value storage? if so, what are the limits/pricing ?
kian
kian10mo ago
#workers-discussions would be a better fit but not really. I mean, can you? Yes - but there is no guarantee you'll hit the same colo, or that the colo still has that file in cache.
bun
bun10mo ago
so cache is not consistent
Isaac McFadyen
Isaac McFadyen10mo ago
Cache is consistent, but is not globally consistent (if you hit another cloudflare datacenter there will be a different cache instance) and may have data evicted at any time if it needs to make room for other content. So not a good idea for key-value storage.
bun
bun10mo ago
ok sure but there are no limits for cache?
Want results from more Discord servers?
Add your server