worker.__main__

Module Contents

worker.__main__.logger[source]
worker.__main__.choose_backend(backend)[source]
Resolves scanner name string to implementation
Parameters
  • backend (str) – Name of the backend to load, either one of the predefined implementations or the name of a module

  • load (to) –

  • (module – ClassName syntax or default of module:Scanner)

Returns

Scanner class of the selected implementation

Return type

(Class)

Raises

(Exception) – If backend is not found

worker.__main__.main(log, client_log, redis_addr, queue, backend, tasks, download_limit, scan_limit, api_key, testing, log_format)[source]
Entrypoint for the worker driver
Parameters
  • log (str) – Logging level for all app logs

  • client_log (str) – Logging level for all polyswarmclient logs

  • redis_addr (str) – Address of redis

  • backend (str) – Backend implementation to use

  • queue (str) – Name of queue to listen on

  • tasks (int) – Number of simultaneous tasks this worker runs

  • download_limit (int) – Number of simultaneous downloads this worker can handle

  • scan_limit (int) – Number of simultaneous scans this worker can handle

  • api_key (str) – API key to use with polyswarmd

  • testing (int) – Mode to process N bounties then exit (optional)

  • log_format (str) – Format to output logs in. text or json