You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support cancel / delete of in-flight stream messages (#216)
* Add cancelation metadata to Redis
Add some cancelation metadata to redis that allows API to introspect the
stream and message ID from the prediction ID. This allows api to perform
an `XDEL` on the redis message when a cancelation is received. The only
time an `XDEL` should happen is if the prediction has not started.
API will be responsible to check `XPENDING` and/or the prediciton cache.
Additionally API should `DEL` the meta key when it performs a
cancelation or when the prediction completes.
key format: `meta:cancelation:<prediction_id>` and it contains json
in the form of: `{"stream_id": "<stream key>", "msg_id": "<redis message
id>"}`
* Move message tracking to separate write script
and add client `Del` command for the other side.
* Shore up tests for queue client Del
and switch meta cancelation key prefix to start with `_` instead of `:`
given the latter tends to be expected as a separator, imho.
* Renaming to "track field" and using the sha1 of the field value
for better alignment with current names and a smidge of safety.
* Combine two string ops for efficiency
Co-authored-by: Mark Phelps <[email protected]>
* A few more refinements based on PR feedback
---------
Co-authored-by: Morgan Fainberg <[email protected]>
Co-authored-by: Mark Phelps <[email protected]>
0 commit comments