embucket-labs icon indicating copy to clipboard operation
embucket-labs copied to clipboard

Add async execution support to the api-ui REST API

Open YaroslavLitvinov opened this issue 2 months ago • 1 comments

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 createQuery handler POST /ui/queries Add payload param: asyncExec to the , reflect changes in openapi spec. Keep existing functionality of sync execution when asyncExec=false, Run query asynchronously when asyncExec=true
  • [ ] Add for future use DELETE /ui/queries handler, aborts running query by query_id or it can be PATCH /ui/queries, expecting additional payload arg: abort=true/false

YaroslavLitvinov avatar Oct 14 '25 10:10 YaroslavLitvinov

2 proposals:

  1. Maybe let's use syncExec (default = false) in POST /ui/queries. • syncExec=true → run query synchronously. • syncExec=false → run asynchronously (default).

  2. POST /ui/queries/{query_id}/abort to explicitly abort a running or queued query. A bit clearer than using DELETE or PATCH.

@YaroslavLitvinov WDYT?

nikitastryuk avatar Oct 14 '25 12:10 nikitastryuk