Socket
Socket
Sign inDemoInstall

dock

Package Overview
Dependencies
0
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    dock

Batch job queue for ML inference.


Maintainers
1

Readme

dock

Wrapper around Redis for message queues.

Installation

pip install dock  # pypi
pip install git+https://github.com/vzhong/dock.git  # github

Usage

First, start your Redis server.

# server.py
from dock import Dock
dock = Dock('test')

while True:
    msg, respond = dock.recv()
    print(msg, respond)
    print('got message {}'.format(msg))
    respond({
      'ack': msg,
      'msg': 'hello'
    })
# client.py
from dock import Dock
dock = Dock('test')

for i in range(5):
    answer = dock.send('message{}'.format(i))
    print(answer)

You can see how the server and client interact by running the two files:

python server.py  # in one terminal
python client.py  # in another terminal

Keywords

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc