obs-websocket icon indicating copy to clipboard operation
obs-websocket copied to clipboard

Feature Request: Interruptible request batches

Open Nixill opened this issue 1 year ago • 7 comments

Feature Request Type

RPC Request

Feature Request Type (Other)

No response

Requested Feature

Three related things:

1. RequestStatus::Interrupted

Given a value of 208 or whatever's next in the 200s at the time of implementation, this request status is the returned status for unprocessed inner requests within a request batch. If haltOnError was true, then this is only returned for the first interrupted inner request; otherwise, it is returned for all unprocessed inner requests.

2. Request: InterruptRequestBatch

Interrupts a running request batch sent by the same client.

Cannot interrupt an inner request that is in the middle of being processed, unless that inner request is a Sleep request. If not, the next request to be processed (and all thereafter) will instead be skipped with an Interrupted request status.

Has the following three parameters.

Name Type Description Default
requestBatchId String The top-level ID of the request to interrupt N/A
?innerRequestId String The ID of the inner request before which execution should be halted The next inner request to be processed
?comment String String The comment that should be provided alongside RequestStatus::Interrupted

Some potential returned Request Status codes include:

  • 100 Success: The request batch was interrupted successfully.
  • 600 Resource Not Found:
    • No request batch with the given ID was made by the calling client.
    • An inner request with the given ID was not part of the request batch with the given ID.
  • 604 Invalid Resource State:
    • The request batch with the given ID was already completed, or is on its final inner request.
    • The inner request with the given ID was already processed.
    • The request batch with the given ID was submitted as RequestBatchExecutionType::Parallel.

3. Request batch parameter: interruptOnDisconnect

Placed directly in the d of a request batch message. Defaults to false, preserving current behavior. When true, if the client that sends this request batch disconnects in the middle of its execution, it is interrupted immediately.

Requested Feature Usage Scenario

It would be nice to be able to interrupt animations that I've started from the websocket client.

Edit

Made the headings within the "Requested Feature" heading a lower level than that heading itself.

Nixill avatar Aug 10 '24 22:08 Nixill

... This would be especially useful when I accidentally send a 15 minute long batch request because I changed something 30 seconds long from 1fps to 30fps without cutting the sleep from 30 frames to 1 frame.

Nixill avatar Aug 10 '24 23:08 Nixill

+1

Oceanity avatar Aug 16 '24 12:08 Oceanity

+1

dennisrijsdijk avatar Aug 16 '24 13:08 dennisrijsdijk

+1

CKY- avatar Aug 16 '24 13:08 CKY-

+2

phroggster avatar Aug 16 '24 13:08 phroggster

+1 this would be really useful as I want OBS to handle a lot of things that requires timing between actions and stuff, but still need it to be interruptible, doing the timings from my code and sending the request one by one is not exact enough.

bikutaa-dev avatar Nov 29 '24 08:11 bikutaa-dev

+1, ran into a situation where this would be mighty helpful for my team.

Landiie avatar Jan 15 '25 13:01 Landiie