Skip to main content

ipcq

A simple inter-process communication (IPC) Queue built on top of the built-in library multiprocessing.

Quick Start

Server

import ipcq


with ipcq.QueueManagerServer(address=ipcq.Address.DEFAULT, authkey=ipcq.AuthKey.DEFAULT) as server:
    server.get_queue().get()

Client

import ipcq


client = ipcq.QueueManagerClient(address=ipcq.Address.DEFAULT, authkey=ipcq.AuthKey.DEFAULT)
client.get_queue().put('a message')

Please checkout out the examples folder for more examples.

API

class ipcq.QueueManagerServer(address: Optional[str], authkey: Optional[bytes])

This class inherits multiprocessing.managers.BaseManager.

address can be ipcq.Address.AUTO, ipcq.Address.CWD or any other path described in str. When it's given ipcq.Address.AUTO, a random address will be chosen. ipcq.Address.CWD means using a file that lives in the current working directory.

authkey is just like the password for authentication. It can be ipcq.AuthKey.AUTO, ipcq.AuthKey.DEFAULT, ipcq.AuthKey.EMPTY or any other arbitrary bytes.

def get_queue(ident: Union[AnyStr, int, type(None)] = None) -> queue.Queue

The method returns a queue.Queue corresponding with ident. The returned queue is shared between the server and the client. So both the server and the client access to the same queue.

ident is the identity, it can be any string-like object, int or None. The default is None. It is used for differetiate the obtained queues. Different idents refer to different queues.

class ipcq.QueueManagerClient(address: Optional[str], authkey: Optional[bytes])

This class inherits multiprocessing.managers.BaseManager.

address can be ipcq.Address.CWD or any other path described in str. When the server is set with ipcq.Address.CWD and the client is running in the same CWD that the server runs, the client can be set with ipcq.Address.CWD as well. Otherwise, it should be the same with the address field in the server instance.

authkey is just like the password for authentication. It has to be the same with what's set on the server . If the server was set with ipcq.AuthKey.DEFAULT or ipcq.AuthKey.EMPTY, the client can just be set with the same.

def get_queue(ident: Union[AnyStr, int, type(None)] = None) -> queue.Queue

The method returns a queue.Queue corresponding with ident. The returned queue is shared between the server and the client. So both the server and the client access to the same queue.

ident is the identity, it can be any string-like object, int or None. The default is None. It is used for differetiate the obtained queues. Different idents refer to different queues.

Metadata

Release files for ipcq 1.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ipcq 1.1.3
File Size Uploaded
ipcq-1.1.3.tar.gz 8.3 kB Details

Release files / ipcq-1.1.3.tar.gz

Download URL ipcq-1.1.3.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
87a6c391359437d54a34c39be13f94c9152bf4e82396c17f0d85bca74fa75827
BLAKE2b-256 checksum
How to use checksums
579613efe5d9e8f1ad50f3e9ffd733d1a58ff094048f604ed2388705306dc715
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.10.4 Windows/10

Release history Release notifications | RSS feed

This release

1.1.3 This release

1 release file

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page