embucket-labs
embucket-labs copied to clipboard
Add async execution support to the api-ui REST API
Since we implemented async execution earlier in this PR https://github.com/Embucket/embucket/pull/1637, and closed issue https://github.com/Embucket/embucket/issues/1609 we need to support it in UI as well.
Proposal
- [x] Change
createQueryhandlerPOST /ui/queriesAdd payload param:asyncExecto the , reflect changes in openapi spec. Keep existing functionality of sync execution whenasyncExec=false, Run query asynchronously whenasyncExec=true - [ ] Add for future use
DELETE /ui/querieshandler, aborts running query by query_id or it can bePATCH /ui/queries, expecting additional payload arg:abort=true/false
2 proposals:
-
Maybe let's use syncExec (default = false) in POST /ui/queries. • syncExec=true → run query synchronously. • syncExec=false → run asynchronously (default).
-
POST /ui/queries/{query_id}/abort to explicitly abort a running or queued query. A bit clearer than using DELETE or PATCH.
@YaroslavLitvinov WDYT?