Repository navigation
Application with multiple asyncua clients and subscriptions. #1770
NikolaiTolstovCoperion
started this conversation in
General
Replies: 2 comments 1 reply
|
@NikolaiTolstovCoperion each instance of main need to run in a different task! Older Syntax was: asyncio.ensure_future(opcua_client1())
asyncio.ensure_future(opcua_client2())
asyncio.ensure_future(opcua_client3())
asyncio.get_event_loop().run_forever()the new Syntax is: async def main():
asyncio.create_task(opcua_client1())
asyncio.create_task(opcua_client2())
asyncio.create_task(opcua_client3())
asyncio.run(main()) |
1 reply
|
A short input: the client is not thread-safe. An error raised in one task led to the disconnection of the other client. Somehow, some bottom communication is shared between tasks. We ended up using the multiprocessing "spawn" method and separate processes to split the clients, which worked in the end. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello everyone,
I have a question. Is it possible to have in application with asyncua few connections to different OPC UA servers? Every connection has a subscription to some list tags.
Based on examples, the normal script start in function main:
but when script come to while loop, another blocks of code will be ignored.
I want to have additional connections to other OPC UA servers and also to add additional functions, for example for checking connections, collecting statistics and other.
Thanks for answers!
All reactions