pico-engine
pico-engine copied to clipboard
Refactor subscription ruleset to provide wrapper around `picoQuery` for use with subscriptions
This will support an issue in the fully-sharded-database repo.
The io.picolabs.subscription
ruleset has a sendEventToSubCheck
rule which does some setup in the pre
block and then raises an event which sends events "through" given subscriptions.
We ought to move that code into a global function so that it can be used in a new provided function that does a query through a given subscription. In the case of events, we can send multiples, but in this case, a query, we would have to just used a single subscription. So, maybe it will be just similar code? In any case, the new function ought to prepare everything and then call wrangler:picoQuery
to make the actual query.
I think this is another way of stating (part of) issue #574