This project contains example code that demonstrates the use of the Diffusion APIs.
Please refer to the online documentation for further details.
Diffusion API and Getting Started Examples
License: Apache License 2.0
This project contains example code that demonstrates the use of the Diffusion APIs.
Please refer to the online documentation for further details.
Hi, in 6.9.0 version, i receive the error when import diffusion.
Traceback (most recent call last): File "/Users/academiadosbots/Documents/Trade/william_hill/teste_diffusion.py", line 2, in <module> import diffusion File "/Users/academiadosbots/Documents/Trade/william_hill/.envw/lib/python3.10/site-packages/diffusion/__init__.py", line 4, in <module> from .internal.protocol import SessionId File "/Users/academiadosbots/Documents/Trade/william_hill/.envw/lib/python3.10/site-packages/diffusion/internal/protocol/__init__.py", line 22, in <module> from .message_types import read_stream, ServiceRequestMessage File "/Users/academiadosbots/Documents/Trade/william_hill/.envw/lib/python3.10/site-packages/diffusion/internal/protocol/message_types.py", line 14, in <module> from diffusion.internal.session.exception_handler import ErrorReasonException File "/Users/academiadosbots/Documents/Trade/william_hill/.envw/lib/python3.10/site-packages/diffusion/internal/session/exception_handler.py", line 17, in <module> from diffusion.session.exceptions import ( File "/Users/academiadosbots/Documents/Trade/william_hill/.envw/lib/python3.10/site-packages/diffusion/session/__init__.py", line 25, in <module> from diffusion.session.locks.session_locks import SessionLocks, SessionLock File "/Users/academiadosbots/Documents/Trade/william_hill/.envw/lib/python3.10/site-packages/diffusion/session/locks/session_locks.py", line 33, in <module> class SessionLocks(object): File "/Users/academiadosbots/Documents/Trade/william_hill/.envw/lib/python3.10/site-packages/diffusion/session/locks/session_locks.py", line 131, in SessionLocks async def lock( File "/Users/academiadosbots/Documents/Trade/william_hill/.envw/lib/python3.10/site-packages/diffusion/internal/utils.py", line 261, in transformer validated_main_func = validator(func) File "pydantic/decorator.py", line 36, in pydantic.decorator.validate_arguments.validate File "pydantic/decorator.py", line 78, in pydantic.decorator.ValidatedFunction.__init__ File "pydantic/typing.py", line 77, in pydantic.typing.get_all_type_hints 'AsyncContextManager', File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/typing.py", line 1870, in get_type_hints value = _eval_type(value, globalns, localns) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/typing.py", line 327, in _eval_type return t._evaluate(globalns, localns, recursive_guard) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/typing.py", line 699, in _evaluate self.__forward_value__ = _eval_type( File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/typing.py", line 327, in _eval_type return t._evaluate(globalns, localns, recursive_guard) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/typing.py", line 694, in _evaluate eval(self.__forward_code__, globalns, localns), File "<string>", line 1, in <module> NameError: name 'SessionLock' is not defined. Did you mean: 'SessionLockScope'? profiling: /Users/jenkins/builds/ppJmC2r-/0/engineering/diffusion-sdk/dependencies/python-core/build/python/build/temp.macosx-10.9-x86_64-cpython-310/CMakeFiles/diffusion_core.dir/src/main/bindings/python/cbor.cpp.gcda: cannot open: No such file or directory profiling: /Users/jenkins/builds/ppJmC2r-/0/engineering/diffusion-sdk/dependencies/python-core/build/python/build/temp.macosx-10.9-x86_64-cpython-310/CMakeFiles/diffusion_core.dir/src/main/bindings/python/delta.cpp.gcda: cannot open: No such file or directory profiling: /Users/jenkins/builds/ppJmC2r-/0/engineering/diffusion-sdk/dependencies/python-core/build/python/build/temp.macosx-10.9-x86_64-cpython-310/CMakeFiles/diffusion_core.dir/src/main/bindings/python/main.cpp.gcda: cannot open: No such file or directory profiling: /Users/jenkins/builds/ppJmC2r-/0/engineering/diffusion-sdk/dependencies/python-core/build/python/build/temp.macosx-10.9-x86_64-cpython-310/CMakeFiles/diffusion_core.dir/src/main/cxx_api/buffer.cpp.gcda: cannot open: No such file or directory
Thanks.
Im using diffusion sdk 5.9.0 and able to connect and subscribe to topic is correct connection props and topic name are given.
Now, if i give incorrect topic name to session.subscribe function I don't get any error event on my session. Can you help how can i get the error event in above case?
When closing the client session from the Diffusion console, MissingTopicNotificationStream#onClose()
is never called. However, if I use MissingTopicHandler#onClose()
, which is marked as deprecated, it is called.
// works
topicControl.addMissingTopicHandler(topic, new TopicControl.MissingTopicHandler() {
@Override
public void onMissingTopic(TopicControl.MissingTopicNotification missingTopicNotification) {
logger.info("request: {}", missingTopicNotification.getTopicPath());
}
@Override
public void onActive(String s, RegisteredHandler registeredHandler) {
logger.info("active");
}
@Override
public void onClose(String s) {
logger.error("close"); // it's called!
}
});
// doesn't work
topicControl.addMissingTopicHandler(topic, new TopicControl.MissingTopicNotificationStream() {
@Override
public void onMissingTopic(TopicControl.MissingTopicNotification missingTopicNotification) {
logger.info("request: {}", missingTopicNotification.getTopicPath());
}
@Override
public void onError(ErrorReason errorReason) {
logger.error("error");
}
@Override
public void onClose() {
logger.error("close"); // it's not called!
}
});
Client version: implementation 'com.pushtechnology.diffusion:diffusion-client:6.8.9'
Server version: 6.8.9
(the same behavior is observed on higher versions).
The JS examples require diffusion node client, version on github is too old, are you going to provide a diffusion node js file to run the examples?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.