NATS wrapper for fast scanner development
Project description
NATS wrapper for BorderControl
Instruction for add a new instance of scanner.
from bc.dev.handlers import WorkerThreadHandler
counter = 0
def worker_function(data):
global counter
counter += 1
print(counter)
return {"results": [1, 2, 3, 45]}
a = WorkerThreadHandler(worker_function=worker_function)
a.run()
data - here you see all data which send in sheduler in your channel
{"results": [1, 2, 3, 45]} - send to _reporter as:
{
'task_data': data,
'result': result,
}
worker_function - required arg name - optional hostname - optional
Module send to channel _registration
:
{"hostname": "hostname", "name": "name"}
Module must receive from channel _registration
:
{
'subjects_to_subscribe': ['test'],
'unique_name': 'test_module1',
}
If error will be detected in worker, module send error message to channel _errors
:
{
'task_data': data,
'result': "ERROR"
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for bordercontrol-0.2.0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05f27439776cd6c0998cfbed441fd1da14517c9aa89ee8c9c811d09a314308aa |
|
MD5 | 6aad6fa03f31c380a77f9403a62b34ec |
|
BLAKE2b-256 | fd095a394b22c00033ab2ce9cdcf01ed34bb8f6503859c934ca0040f3379d363 |