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

dora does not handle concurrent call in python #748

Open
haixuanTao opened this issue Jan 7, 2025 Discussed in #746 · 0 comments
Open

dora does not handle concurrent call in python #748

haixuanTao opened this issue Jan 7, 2025 Discussed in #746 · 0 comments
Labels
cli CLI python Python API

Comments

@haixuanTao
Copy link
Collaborator

Discussed in https://github.com/orgs/dora-rs/discussions/746

Originally posted by jrabary January 6, 2025
Hi all,

I'm trying to add an interactive and realtime visualisation node in my graph. I end up having the following events handlers in the GUI

    def handle_submit(command):
        if command != "":
            instruction_array = pa.array([command])
            node.send_output("instruction", instruction_array)
        return ""

    def handle_camera_streams():
        current_im = im
        while True:
            evt = node.next(timeout=FPS)
            if evt is not None:
                if evt["type"] == "INPUT":
                    if evt["id"] == "observations":
                        obs = decode_dict(evt["value"])
                        current_im = obs["overhead_cam"]

            yield current_im

The first one is to handle user action on the GUI and the second on to display a video stream on the GUI. The point is, the two handlers can work separatly but once I put them together I got some errors

node.send_output("instruction", instruction_array)
RuntimeError: Already borrowed

I suspect dora doesn't like I use the same node object concurrently.

Any ideas ?

@github-actions github-actions bot added the cli CLI label Jan 7, 2025
@haixuanTao haixuanTao changed the title Interactive and realtime visualisation with gradio dora does not handle concurrent call in python Jan 7, 2025
@github-actions github-actions bot added the python Python API label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli CLI python Python API
Projects
None yet
Development

No branches or pull requests

1 participant