Skip to main content

Basic binary socket based rpc for Python

Project description

basic_rpc

It's in the name, basic RPC implementation with just enough functionality to solve my own problem.

Currently implemented a threaded server and a blocking client though there's no reason an async server/client couldn't be added.

See greet_server.py and greet_client.py for example usage.

Constraints:

  1. Supports up to 16k registered commands (due to low level command id represented as a 16 bit integer)
  2. Runs on Python 3.6+.

Pros:

  1. No dependencies
  2. Support for managing amount of concurrent users of the RPC service. (I need exclusive access).
  3. Client/Server decoupled from user code.
  4. Some basic support for exceptions.

Cons:

  1. No encryption/authentication
  2. user code responsible for serializing/deserializing messages. The RPC protocol is not aware of the type of arguments/responses being sent. I.e. the message payload is tightly coupled with user code. The tediousness of this is mitigated somewhat by using composable serializer/deserializer functions such as make_serializer. See conftest.py for an example of this. The serialization helper functions reside in rpc_serialization_functions.
  3. No autogeneration logic to generate RPC APIs.
  4. parsing of large messages slow due to inefficient copying

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

basic_socket_rpc-0.2.0.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

basic_socket_rpc-0.2.0-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file basic_socket_rpc-0.2.0.tar.gz.

File metadata

  • Download URL: basic_socket_rpc-0.2.0.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for basic_socket_rpc-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4dc53ac1a490c23d5ca0d8c9920660ff5e8743a31036113733fa6d94f8f1890a
MD5 fd4f888335c948de8ad4f7dc82dc2c7b
BLAKE2b-256 edfe7e9d4d7b13fc036d3b3254745d83d7a8622082a9872fd2dcbfa7dd3a72d5

See more details on using hashes here.

File details

Details for the file basic_socket_rpc-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for basic_socket_rpc-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c07c21a7751407b8f20759102bcb1b14d1d5ed9333a43b91f4d85f7f7745e23
MD5 b8daff02adc23b6a1face80d14b4b6d9
BLAKE2b-256 50643511625cb12df35276562bb61f1b79ce64e291d6d274b66a68e71ee8b1a9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page