Skip to main content

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',
}
```


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bordercontrol-0.2.0.0.1.tar.gz (1.9 kB view hashes)

Uploaded Source

Built Distribution

bordercontrol-0.2.0.0.1-py3-none-any.whl (2.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page