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

v5 Request - Adopt Async/Task based requests

Open grofit opened this issue 3 years ago • 6 comments

Issue Type

  • Feature Request

Describe the issue Currently all calls to do requests with OBS are synchronous not making use of Task (and potentially async), given there has been a large push to move towards this paradigm by a lot of vendors who can do potentially long running tasks, i.e IO, Network, API, DB calls etc it would be good if we could provide async compatible requests.

Versions OBS Version: N/A OBS WebSocket Version: 5.x OBS WebSocket Dotnet (this library) Version: 5.x OS: N/A

Additional context There was a PR offered for the v4 branch which included these changes which allowed for mainly non blocking requests to OBS which helps greatly with UI facing applications, unfortunately that PR never made it through, but it would be great if the same approaches could be rolled into the v5 branch.

grofit avatar Sep 06 '22 13:09 grofit

Overall I'm fine moving towards async/await however don't have the bandwidth for this. If you want to make a targeted PR, can look into it

BarRaider avatar Sep 06 '22 13:09 BarRaider

Thats understandable, at the moment I am still on the v4 version but at some point would want to move over to v5 so if I have time and you are open to it I will submit a PR for it as @Zingabopp has already done most of the legwork for this in the v4 branch, its just transposing their handling of it over and changing function sigs.

grofit avatar Sep 06 '22 13:09 grofit

Just make sure it doesn't turn to be too big of PR

BarRaider avatar Sep 06 '22 14:09 BarRaider

However you spin it, bare minimum its going to need to change the signatures of almost all request methods from T Whatever() to Task<T> Whatever() and all the corresponding methods related to it as well as cancellation token parts as well.

So just to make sure we are on the same page this will ultimately have cascading changes everywhere, but the PR (assuming im the one who does it) will JUST be related to this issue.

grofit avatar Sep 06 '22 14:09 grofit

👍

BarRaider avatar Sep 06 '22 14:09 BarRaider

How about this?

jeiea avatar Oct 18 '22 13:10 jeiea