Package: callosum
CallosumAn RPC Transport LibraryIt provides an asynchronous multi-channel order-preserving message and data
streaming transport forupperRPC layers (e.g., Apache Thrift) by wrappinglowertransport implementations (e.g., ZeroMQ).It aims to follow the latest coding style and conventions in Python asyncio.Corpus callosumis a bundle of neuron fibers that connects two cerebral
hemispheres of a human brain.PrerequisitePython 3.11 or higher.FeaturesRPCNative timeout and cancellation supportExplicit server-to-client error propagation including stringified tracebacksOrder preserving based on user-defined keys while keeping executions asynchronousStreamingBroadcast & shared pipelinesOptional client authentication and encrypted communicationCurrently supported for only ZeroMQ with its CURVE libraryOptional message compression usingsnappyReplacible and combinable lower/upper layers (ZeroMQ/Redis + JSON/msgpack/Thrift)Planned featuresManaged streaming (with acks)Tunneling to bundle other channels and generic network traffic in a single connectionBidirectional RPCChunked transfer of large messagesInstallationTo install the core:$pipinstall-Upipsetuptools$pipinstallcallosumYou may add extra dependencies like:$pipinstall'callosum[zeromq,redis,thrift,snappy]'ExamplesPlease check outthe examples directory.DevelopmentCreate a virtual environment or an isolated Python environment using your favorite tool.Inside it, run editable installation as follows:$pipinstall-Upipsetuptools$pipinstall-U-rrequirements/dev.txtChanges1.0.2 (2024-02-29)FixesStabilize ZMQ RPC auth and malformed packet handling (#27)### MiscellaneousUpdate dependencies including pyzmq ('>=23' → '>=25.1.1' to support Python 3.12) and development tools including ruff to replace the black formatter (#26)v1.0.1 (2023-09-18)FixesPrevent leaking secret keys in the logs and allow infinite timeouts on connection pings (#24)v1.0.0 (2023-09-14)Breaking changeNow it requires Python 3.11 to work!FeaturesImplement the full version of secure, encrypted RPC communication based on ZeroMQ's ZAP protocol using CURVE keypairs (#21)v0.9.10 (2022-02-17)FixesFix pyzmq attribute error on Ubuntu 20.04 at aarch64, which is built using older libzeromq without some socket monitoring event constants, by loading the constant declarations dynamically (#20)v0.9.9 (2021-10-05)FixesAdd explicittask_done()call to the output queue ofrpc.Peerinstances to avoid potential missing wakeup on joined coroutines (#16)v0.9.8 (2021-10-05)Featureslower.zeromq: Add a transport option to attach monitors for logging underlying socket events (#17)FixesImprovezsock_optshandling when explicitly specified by the library users, as previously it caused argument errors in binders and connectors (#18)v0.9.7 (2020-12-22)FeaturesProviderepr()of exceptions in RPC user/internal errors for better application-level error logging (#15)v0.9.6 (2020-06-05)Featuresupper.rpc: Support server-side cancellation and propagation to clients by adding theCANCELLEDRPC message type (#14)DeprecationsDrop use of aiojobs in favor of native semaphores for limiting the task concurrency and less clutters on job scheduling semantics (#14)FixesStability updates for the RPC layer: (#14)Fix wrong message sequence calcuation withSEQ_BITSand clarify the roles ofcleanup()andcancel()methods in the schedulers.Now we use the exit-ordered scheduler by default.v0.9.5 (2020-05-12)Fixeslower.zeromq: Use destroy() for zmq context termination to improve stability and shutdown open socekts cleanly (#13)v0.9.4 (2020-04-10)FixesFix a race condition due to overlapping RPC message sequence IDs by separating server/client message sequence IDs(#12)MiscellaneousAdopt towncrier for changelog management(#11)v0.9.3 (2020-03-20)FIX: Mitigate bogus KeyError when cleaning up task futures in RPC servers that has caused event
loop spinning.v0.9.2 (2020-02-28)MAINTENANCE: Update dependencies and only specify the minimum versions since
Callosum is a library.v0.9.1 (2020-01-05)FIX: wrong typing ofRPCMessage.bodyfieldIMPROVE: Adddebug_rpcoption torpc.Peerfor logging exceptions in RPC
scheduler and user-defined handlers explicitly.Update dependencies and remove unused ones.v0.9.0 (2019-12-06)First public release with a working RPC based on ZeroMQ DEALER/ROUTER sockets.2018-05-02Started the project.