Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async oscpy, question, help ! #59

Open
bueltan opened this issue Apr 10, 2021 · 1 comment
Open

Async oscpy, question, help ! #59

bueltan opened this issue Apr 10, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@bueltan
Copy link

bueltan commented Apr 10, 2021

Hi, how could I implement oscpy with cooroutines using asyncio, I don't understand how to implement the below.
OSCAsyncServer exist in somewere ?

Server (async) (TODO!)

from oscpy.server import OSCThreadServer

with OSCAsyncServer(port=8000) as OSC:
for address, values in OSC.listen():
if address == b'/example':
print("got {} on /example".format(values))
else:
print("unknown address {}".format(address))

@bueltan bueltan changed the title Async oscpy, help ! Async oscpy, question, help ! Apr 10, 2021
@tshirtman
Copy link
Member

tshirtman commented Apr 10, 2021

No, this server needs to be done, i didn't find the time to do it, and i didn't had the need for it either.
I assume it shouldn't be very hard to do, at least in a naive form, since there is no backpressure to handle in an udp stream (afaik), but because i didn't do any serious asyncio work yet, I might not build the most sensible api for it.

If you (or anyone) wants to try it, i should be able to help anyway, considering parsing is pretty much split from any network handling, only some parts from the OSCThreadServer might require adaptation for an asyncio usage, maybe creating a parent class containing the common logic, or extracting them in a different module to be used any other contexts if needed.

@Julian-O Julian-O added the enhancement New feature or request label Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants