Metadata-Version: 2.1
Name: communica
Version: 0.3.1
Summary: Easy to use IPC library
Author-email: Elchin Sarkarov <elchin751@gmail.com>
Project-URL: Homepage, https://github.com/elchinchel/communica-py
Project-URL: Bug Tracker, https://github.com/elchinchel/communica-py/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: POSIX
Classifier: Operating System :: Microsoft :: Windows
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: typing-extensions
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: pytest-asyncio; extra == "test"
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: myst-parser; extra == "docs"
Requires-Dist: python-docs-theme; extra == "docs"
Requires-Dist: sphinx-autodoc2; extra == "docs"
Provides-Extra: orjson
Requires-Dist: orjson; extra == "orjson"
Provides-Extra: adaptix
Requires-Dist: adaptix; extra == "adaptix"
Provides-Extra: rabbitmq
Requires-Dist: aiormq; extra == "rabbitmq"
Requires-Dist: yarl; extra == "rabbitmq"

# Easy to use IPC library

Sometimes there is no need for complicated
blazingly fast connections with incredible throughput
and even more incredible configuration.
You just want made your processes **communicate** with each other. And that's what this library for.

### Idea

There is two main _entities_: `Client` and `Server`,
which uses `Connectors` to create `Connections`.

The only way client and server differs is who initiate a connection. After successful connect there is
no difference between them, any side can make requests to other.

### Entities

Pairs of Client and Server entities.

| Entity | Description |
| --- | --- |
| Simple | These entities have only one handler and two operations: `request` (send message, wait response, return it) and `throw` (send message and notify responder, that response can be dropped). They use `Serializers` to serialize request data. |
| Route | Similar to simple, but have multiple handlers, identified by exact string match. |

### Connectors:

Things which making connections. Connector can be serialized and passed to other processes, e.g. parent process creates connector, run server with it and start childs, which run clients with same connector.

| Connector | Description |
| --- | --- |
| LocalConnector | Uses Named Pipes on Windows and Unix domain sockets on other systems, if available. This is similar to multiprocessing's connection, but LocalConnector doesn't fallback to TCP. |
| TcpConnector | Uses TCP/IP protocol. |
| RmqConnector | Uses AMQP message broker, can be scaled. |

### Extras

You can install additional dependencies for various features

`pip install communica[extraname1, extraname2]`
| Extra name | Feature |
| --- | --- |
| orjson | Faster JSON library, recommended with CPython. |
| rabbitmq | RmqConnector, which use AMQP server for communication. |
