Skip to content

Replacement for add_object #1607

Answered by schroeder-
varunJainV asked this question in Q&A
Discussion options

You must be logged in to vote

You can use async, to run multiple corotines parallel like this:

async def create_object(extchannels, num):
     myobj1 = await extchannels.add_object(ua.NodeId(NamespaceIndex=ns),'2:ExternalChannel_%s' % num,external_channels)
     ....

coros = [create_object(extchannels, num) for num in range(1, channeldata + 1, 1)]
await asyncio.gather(*coros)

Othwise you can talk directly to the lower layer and make a modified version of

async def _create_object(session, parentnodeid, nodeid, qname, objecttype):
and handle multiple add object calls at once.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by oroulet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1605 on March 22, 2024 13:42.