arcor2
arcor2 copied to clipboard
Refactor WS clients
Currently, there is one implementation of WS server (used by ARServer and Execution) but there are more implementations of WS clients:
-
arcor2_arserverhas asyncio client for Execution. -
arcor2_arserver_datahas a client for ARServer, that is used in ARServer tests so far. -
arcor2_execution_rest_proxyhas a client for Execution.
Ideal state:
- There is a
wsmodule inarcor2that contains a general implementation of a server (already exists) and a client.- The question is whether the general client should be sync or async.
- It should be possible to run async code from sync one (even within Flask).
- Another option would be to make it sync and prepare an async wrapper.
-
arcor2_arserver_datacontains a client for ARServer.- To be used in tests, or in some alternative user interfaces.
-
arcor2_execution_datacontains the client for Execution.- To be used by ARServer and Execution Rest Proxy.
Also, event/RPC mapping currently happens in multiple places. It should be refactored into respective clients.