You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

dock

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dock

Batch job queue for ML inference.

0.0.1
pipPyPI
Maintainers
1

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

text nlp machine-learning

FAQs

Did you know?

Socket

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