Skip to main content

PyPI

🌪️ Twist

Fast and reliable distributed systems in Python.

Installation

pip install twist

Example

This example runs the server and client in the same Python program using subprocesses, but they could also be separate Python scripts running on different machines.

def server():
  import twist
  server = twist.Server(2222)
  server.bind('add', lambda x, y: x + y)
  server.bind('greet', lambda msg: print('Message from client:', msg))
  server.start()

def client():
  import twist
  client = twist.Client('localhost', 2222)
  future = client.add(12, 42)
  result = future.result()
  print(result)  # 54
  client.greet('Hello World')

if __name__ == '__main__':
  import twist
  server_proc = twist.Process(server, start=True)
  client_proc = twist.Process(client, start=True)
  client_proc.join()
  server_proc.kill()
  print('Done')

Release files for twist 0.1.0

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

Source distribution (sdist)

Source distribution for twist 0.1.0
File Size Uploaded
twist-0.1.0.tar.gz 25.4 kB Details

Release files / twist-0.1.0.tar.gz

Download URL twist-0.1.0.tar.gz
Size 25.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1de4d9283f65f2632d306f451e9fb9b1ec04476cae00b487ba3af45b7ce04c1a
BLAKE2b-256 checksum
How to use checksums
1c9f1b3a272b8df3ff9772e4eaede6f88e61ad8fb379c05938016d9979cfab47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

0.0.1

1 release file

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