| Total Complexity | 1 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import click |
||
| 2 | from .. import ( |
||
| 3 | ProcessingServer, |
||
| 4 | ServerAddressParamType |
||
| 5 | ) |
||
| 6 | |||
| 7 | |||
| 8 | @click.command('processing-server') |
||
| 9 | @click.argument('path_to_config', required=True, type=click.STRING) |
||
| 10 | @click.option('-a', '--address', |
||
| 11 | default="localhost:8080", |
||
| 12 | help='The URL of the Processing server, format: host:port', |
||
| 13 | type=ServerAddressParamType(), |
||
| 14 | required=True) |
||
| 15 | def processing_server_cli(path_to_config, address: str): |
||
| 16 | """ |
||
| 17 | Start the Processing Server |
||
| 18 | (proxy between the user and the |
||
| 19 | Processing Worker(s) / Processor Server(s)) |
||
| 20 | """ |
||
| 21 | |||
| 22 | # Note, the address is already validated with the type field |
||
| 23 | host, port = address.split(':') |
||
| 24 | processing_server = ProcessingServer(path_to_config, host, port) |
||
| 25 | processing_server.start() |
||
| 26 |