semvec/pypi-packages huggingface dataset:
Blackboard 0.1.0
A Python Multicast Client

# Blackboard

## Interface

#### Constructor
`Blackboard(addr=MCAST_GRP, port=MCAST_PORT, read_size=READ_SIZE, TTL=MULTICAST_TTL)`

- `addr`: This is the network address to connect to. It must be an unreserved, available network block that supports the Multicasting protocol. It will default to `244.1.1.1`.
- `port`: This is the port on the network address the Blackboard will connect to. It will default to `5007`.
- `read_size`: This will specify the standard read size when getting data from the network address. It will default to `256` bytes.
- `TTL`: This is the number of times the signal will propagate through the network before being cut off. It will default to `32`.

#### Methods
- `write_json(channel, data)`: This will write the specified data to the specified channel. The channel can be any arbitrary string.
- `get(channel)`: This will return the most recent piece of data received on a specified channel.
- `register_callback(channel, f)`: This will add a callback function that will be called when a specific channel gets data. The callback must be a function that gets a single argument of the data from the channel.
- `is_open()`: This function will return `True` if the Blackboard is connected to the network, and `False` otherwise.
stepfunctions-activity-worker 1.1.3
Activity worker for performing AWS StepFunctions tasks

# StepFunctions Activity Worker

A worker that listens to a StepFunctions activity and executes a provided function using the inputs from the activity task.

The StepFunctions Activity Worker encapsulates all the parts of communicating with the StepFunctions API so you don't have to worry about task heartbeats or maintaining task tokens and success/failure scenarios; all you have to worry about is executing the task.

### Installation

Install from [PyPI](https://pypi.org/project/stepfunctions-activity-worker/):

```
pip install stepfunctions_activity_worker
```


### Usage

```python
from stepfunctions_activity_worker import ActivityWorker


def my_task(**task_input):
    """Perform the task based on this task's input."""
    # Perform your task here! 
    return {"result": "done!"}


if __name__ == "__main__":
    activity_arn = "PLACE YOUR ACTIVITY ARN HERE"
    worker = ActivityWorker(activity_arn, my_task)
    worker.listen()
```

## Warning

The `ActivityWorker` class, if not provided with a `client` argument on instantiation, will create a *properly configured* client from your default session.

However, if you are providing an already instantiated `client` to the `ActivityWorker` class, *make sure it is proply configured to make StepFunctions API calls*!

The [`GetActivityTask` API call](https://docs.aws.amazon.com/step-functions/latest/apireference/API_GetActivityTask.html) __blocks for 60 seconds__ which *matches* the [`botocore.config.Config` default `read_timeout`](https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html). This means that if the API response for `GetActivityTask` is not punctual (which it often isn't) it will cause unnecessary retry-requests & eventually bubble up an HTTP exception.

```python
import boto3
import botocore
from stepfunctions_activity_worker import ActivityWorker

def my_task(**task_input):
    """Perform the task based on this task's input."""
    # Perform your task here! 
    return {"result": "done!"}

config = botocore.config.Config(
  read_timeout=70,
  # Insert other custom configuration here
)
stepfunctions = boto3.client('stepfunctions', config=config)

activity_worker = ActivityWorker(activity_arn, my_task, client=stepfunctions)
```
mod_ngarn 3.5
Simple async worker
Requires Python: ~=3.6

# mod-ngarn

[![CircleCI](https://circleci.com/gh/Proteus-tech/mod-ngarn.svg?style=svg)](https://circleci.com/gh/Proteus-tech/mod-ngarn) [![PyPI version](https://badge.fury.io/py/mod_ngarn.svg)](https://badge.fury.io/py/mod_ngarn)

## Usage
```
Usage: mod-ngarn [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  create-table     Create mod-ngarn queue table
  delete-job       Delete executed task
  run              Run mod-ngarn job
  wait-for-notify  Wait and listening for NOTIFY
```

## Installation
```
pip install mod-ngarn
```

## Run modngarn
```
Usage: mod-ngarn run [OPTIONS]

  Run mod-ngarn job

Options:
  --queue-table TEXT  Queue table name (Default: os.getenv("DBTABLE",
                      "public.modngarn_job"))
  --limit INTEGER     Limit jobs (Default: 300)
  --max-delay FLOAT   Max delay for failed jobs (seconds) (Default: None)
  --help              Show this message and exit.
```

## Create modngarn job queue table
```
Usage: mod-ngarn create-table [OPTIONS]

Options:
  --queue-table TEXT  Queue table name (Default: os.getenv("DBTABLE",
                      "public.modngarn_job"))
  --help              Show this message and exit.
```

## Wait for notify
```
Usage: mod-ngarn wait-for-notify [OPTIONS]

  Wait and listening for NOTIFY

Options:
  --queue-table TEXT  Queue table name (Default: os.getenv("DBTABLE",
                      "public.modngarn_job"))
  --help              Show this message and exit.
```

## Delete executed job
```
Usage: mod-ngarn delete-job [OPTIONS]

  Delete executed task

Options:
  --queue-table TEXT  Queue table name (Default: os.getenv("DBTABLE",
                      "public.modngarn_job"))
  --help              Show this message and exit.
```

## Example run script
```
#!/bin/bash
set -u

while true
do
    mod-ngarn run $*
    timeout 5 mod-ngarn wait-for-notify
done
```

## Dev
### Required
- flit (https://pypi.org/project/flit/)
- running PostgreSQL (`psql` should work)
- python 3.7

#### Setup
```
flit install
```

#### Runtests
```
./runtests.sh
```

#### Publish to PyPi
```
flit publish
```