Comments (8)
In asyncio you block the async loop until you call the next await. If you need to run code that doesn't call await for a while, there some solutions, like asyncio.to_thread for I/O bound or run_in_executor for cpu bound tasks.
from opcua-asyncio.
I also used the method self._client.get_node(), which is the same as my method implementation basically. However, still no events. What was altered during refactoring / rewriting the library to asyncio in the subscription process? Any ideas to debug the issue?
from opcua-asyncio.
Whats the code after your posted code? If you leave the with Statement the client will disconnect.
from opcua-asyncio.
Well here. Keep_running is true the whole time (same code as with freeopcua, which is working fine).:
while self._keep_running:
pass
print("unsubscribe")
await self._opcua_subscription.unsubscribe(self._opcua_handle)
time.sleep(10)
await self._opcua_subscription.delete()
Maybe next week I get the chance to capture a debug log. Which information do you need, and what commands should I use to get the necessary information?
from opcua-asyncio.
I think you need to give the asyncio some timeslot, also you are wasting cpu cycles. Try this:
while self._keep_running:
await asyncio.sleep(1.0)
from opcua-asyncio.
Thanks for the tip. I will try your snippet as soon as I can enter the factory again.
from opcua-asyncio.
await asyncio.sleep(1.0)
you are officially my hero, never expected that a while pass loop prevents messages from being delivered. Is this asyncio related - do I prevent any internal loops?
from opcua-asyncio.
Thanks for the explanation. I close my issue and reference your answer in the discussion!
from opcua-asyncio.
Related Issues (20)
- Replacement for add_object
- Parent node does not exist issue while starting using server-with-encryption.py HOT 1
- When copy_node is used, BrowseName is not updated
- Stuck in obtaining the read_data_type() of node. Related to asyncio feature. HOT 5
- Exception in subscription loop: struct.error: required argument is not an integer HOT 4
- py.typed marker missing
- Disconnect sometimes HOT 1
- Statuscodes/uaerrors should be regenerated from latest schema
- VariantType and SecurityPolicyType should be IntEnum
- BadIdentityTokenInvalid when connecting to open62541 based server HOT 3
- Infinite Read Requests? HOT 10
- Issue with Migrating from opcua to asyncua.sync: AttributeError when accessing get_objects_node HOT 1
- Bulk reading node attributes causes disconnect
- Subscription tasks not closed properly on OPCUA server shutdown HOT 2
- `call_method` and `uamethod` unpack tuple type HOT 4
- How to properly handle connection issues and reconnecting? (request for comments) HOT 9
- How to use browsepath to get the value of node id. HOT 8
- Possible inconsisent handling of custom datatypes on multiple servers using load_data_type_definitions() HOT 2
- Relax some constraints on dependencies
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opcua-asyncio.