Skip to main content

Memory Object Server

A high-performance Python object sharing pool with distributed capabilities.

Features

  • Support for any Python object: Including system-level objects like sockets
  • Asynchronous communication: Built on asyncio for high performance
  • Minimal API: Simple and intuitive interface
  • Distributed support: Multi-node synchronization and discovery
  • Auto-reconnection: Reliable TCP socket communication with automatic reconnection
  • Thread-safe: Concurrent operations are fully supported
  • Port detection: Smart startup with port availability checking

Installation

pip install memory-obj-server

Quick Start

Server

from memory_obj_pool import Server

server = Server(host='0.0.0.0', port=8765)
server.run()

Client

from memory_obj_pool import SyncClient

client = SyncClient(host='localhost', port=8765)

client.put('key', {'data': 'value'})
result = client.get('key')
print(result)  # {'data': 'value'}

Async Client

import asyncio
from memory_obj_pool import Client

async def main():
    client = Client(host='localhost', port=8765)
    await client.put('key', {'data': 'value'})
    result = await client.get('key')
    print(result)

asyncio.run(main())

API Reference

Server

  • Server(host='0.0.0.0', port=8765, max_size=10000): Create a server instance
  • server.run(): Start the server (blocking)
  • await server.start(): Start the server (async)
  • await server.stop(): Stop the server

Client

  • Client(host='localhost', port=8765, auto_reconnect=True): Create async client
  • await client.connect(): Connect to server
  • await client.put(key, obj): Store an object
  • await client.get(key): Retrieve an object
  • await client.remove(key): Remove an object
  • await client.clear(): Clear all objects
  • await client.size(): Get pool size
  • await client.contains(key): Check if key exists

SyncClient

  • SyncClient(host='localhost', port=8765, auto_reconnect=True): Create sync client
  • client.put(key, obj): Store an object
  • client.get(key): Retrieve an object
  • client.remove(key): Remove an object
  • client.clear(): Clear all objects
  • client.size(): Get pool size
  • client.contains(key): Check if key exists

Distributed Usage

from memory_obj_pool import DistributedPool

pool = DistributedPool(
    node_id='node1',
    known_nodes=[('localhost', 8765)]
)
pool.start()

Requirements

  • Python 3.7+
  • dill
  • asyncio

License

Apache License 2.0

Metadata

Release files for distributed-memory-pool 0.1.1

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

Source distribution (sdist)

Source distribution for distributed-memory-pool 0.1.1
File Size Uploaded
distributed_memory_pool-0.1.1.tar.gz 10.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for distributed-memory-pool 0.1.1
File Interpreter ABI Platform
distributed_memory_pool-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 22.8 kB

Release files / distributed_memory_pool-0.1.1.tar.gz

Download URL distributed_memory_pool-0.1.1.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ef808421a32dec3bd056d128f80fdc02727e51859d84a52cb0b44a9485913803
BLAKE2b-256 checksum
How to use checksums
85039f56f0f97decf8d9a772d55569bb1719069a4eb349b4e3d59e5d325acf62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / distributed_memory_pool-0.1.1-py3-none-any.whl

Download URL distributed_memory_pool-0.1.1-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
48e511483298ba926f3a89e412413265df4c6ac0bbd5c647bc7051939dd07a0b
BLAKE2b-256 checksum
How to use checksums
16021baba1dd1fcee01ae2742a2f93d87f9e05a78aa62041e9a7031c76fdd23f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release history Release notifications | RSS feed

This release

0.1.1 This release

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