NATS wrapper for fast scanner development
Project description
NATS wrapper for BorderControl
==========================================
----------------------------------------------------
Instruction for add a new instance of scanner.
----------------------------------------------------
```python
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',
}
```
==========================================
----------------------------------------------------
Instruction for add a new instance of scanner.
----------------------------------------------------
```python
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',
}
```
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.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57fd52aa65eaa2072006910f0248a5283ad34f6863b90355bc23637050e2a7df |
|
MD5 | e4219620e0711d27ba6ba82f1a06ad0a |
|
BLAKE2b-256 | 2fbd5c57459bd2358452b5bb83a6bbc3b26b409d4df7a68ba568bbe64b73f9ba |