jow- / ucode

JavaScript-like language with optional templating
ISC License
90 stars 30 forks source link

ubus: add explicit support for deferring incoming requests #195

Closed nbd168 closed 6 months ago

nbd168 commented 6 months ago

This is needed when asynchronously processing requests via uloop, e.g. using uclient.

jow- commented 6 months ago

Can you try to add a short ucode usage example to the commit message itself?

So to understand the intent correctly: you want to be able to return from the callback without the request context being replied to, instead you want to stow away the context somewhere and invoke its .reply() later from another scope, e.g. within some timer or io callback?

nbd168 commented 6 months ago

Correct. I added the example that I was testing with.

nbd168 commented 6 months ago

I'm planning on using this in combination with the uclient module that I wrote in order to build a hostapd 'afcd' replacement for 6 GHz frequency coordination (required by FCC for 6 GHz standard power levels).

jow- commented 6 months ago

Merged, thanks!