faust.cli.worker
¶
Program faust worker
used to start application from console.
- class faust.cli.worker.worker(ctx: Context, *args: Any, key_serializer: Optional[Union[CodecT, str]] = None, value_serializer: Optional[Union[CodecT, str]] = None, **kwargs: Any)[source]¶
Start worker instance for given app.
- worker_options = [option('--with-web/--without-web', default=True, help='Enable/disable web server and related components.'), option('--web-port', '-p', default=None, type=<TCPPort 1<=x<=65535>, help='Port to run web server on (default: 6066)'), option('--web-transport', default=None, type=URL, help='Web server transport (default: tcp:)'), option('--web-bind', '-b', type=<class 'str'>), option('--web-host', '-h', default=None, type=<class 'str'>, help='Canonical host name for the web server (default: 0.0.0.0)')]¶
- options: Optional[OptionList] = [option('--with-web/--without-web', default=True, help='Enable/disable web server and related components.'), option('--web-port', '-p', default=None, type=<TCPPort 1<=x<=65535>, help='Port to run web server on (default: 6066)'), option('--web-transport', default=None, type=URL, help='Web server transport (default: tcp:)'), option('--web-bind', '-b', type=<class 'str'>), option('--web-host', '-h', default=None, type=<class 'str'>, help='Canonical host name for the web server (default: 0.0.0.0)'), option('--logfile', '-f', callback=<function compat_option.<locals>._callback>, expose_value=False, default=None, type=<click.types.Path object>, help='Path to logfile (default is <stderr>).'), option('--loglevel', '-l', callback=<function compat_option.<locals>._callback>, expose_value=False, default='WARN', type=Choice(['crit', 'error', 'warn', 'info', 'debug']), help='Logging level to use.'), option('--blocking-timeout', callback=<function compat_option.<locals>._callback>, expose_value=False, default=None, type=<class 'float'>, help='when --debug: Blocking detector timeout.'), option('--console-port', callback=<function compat_option.<locals>._callback>, expose_value=False, default=50101, type=<TCPPort 1<=x<=65535>, help='when --debug: Port to run debugger console on.')]¶
- as_service(loop: AbstractEventLoop, *args: Any, **kwargs: Any) ServiceT [source]¶
Return the service this command should execute.
For the worker we simply start the application itself.
Note
The application will be started using a
faust.Worker
.- Return type:
- banner(worker: Worker) str [source]¶
Generate the text banner emitted before the worker starts.
- Return type:
- key_serializer: CodecArg¶
The codec used to serialize keys. Taken from instance parameters or
key_serializer
.
- value_serialier: CodecArg¶
The codec used to serialize values. Taken from instance parameters or
value_serializer
.
- stdout: IO¶
- stderr: IO¶
- args: Tuple¶