python/scannerpy/database.py
def start_worker(master_address, machine_params=None, port=None, config=None,
                 config_path=None, block=False, watchdog=True):
    """
    Start a worker instance on this node.

    Args:
        master_address: The address of the master server to connect this worker
                        to.

    Kwargs:
        config: A scanner Config object. If specified, config_path is
                ignored.
        config_path: Path to a Scanner configuration TOML, by default
                     assumed to be `~/.scanner.toml`.
        block: If true, will wait until the server is shutdown. Server
               will not shutdown currently unless wait_ror_server_shutdown
               is eventually called.

    Returns:
        A cpp database instance.
    """
    config = config or Config(config_path)
    port = port or config.worker_port

    # Load all protobuf types
    import libscanner as bindings
    db = bindings.Database(
        config.storage_config,
        #storage_config,
        config.db_path,
        master_address)
    machine_params = machine_params or bindings.default_machine_params()
    result = bindings.start_worker(db, machine_params,
                                   str(port).encode('ascii'), watchdog)
    if not result.success:
        raise ScannerException('Failed to start worker: {}'.format(result.msg))
    if block:
        bindings.wait_for_server_shutdown(db)
    return result

    Start a worker instance on this node.

    Args:
        master_address: The address of the master server to connect this worker
                        to.

    Kwargs:
        config: A scanner Config object. If specified, config_path is
                ignored.
        config_path: Path to a Scanner configuration TOML, by default
                     assumed to be `~/.scanner.toml`.
        block: If true, will wait until the server is shutdown. Server
               will not shutdown currently unless wait_ror_server_shutdown
               is eventually called.

    Returns:
        A cpp database instance.
    
Start a worker instance on this node.
Start a worker instance on this node .
def start_worker(master_address, machine_params=None, port=None, config=None,
                 config_path=None, block=False, watchdog=True):
    config = config or Config(config_path)
    port = port or config.worker_port
    import libscanner as bindings
    db = bindings.Database(
        config.storage_config,
        config.db_path,
        master_address)
    machine_params = machine_params or bindings.default_machine_params()
    result = bindings.start_worker(db, machine_params,
                                   str(port).encode('ascii'), watchdog)
    if not result.success:
        raise ScannerException('Failed to start worker: {}'.format(result.msg))
    if block:
        bindings.wait_for_server_shutdown(db)
    return result
def start_worker ( master_address , machine_params = None , port = None , config = None , config_path = None , block = False , watchdog = True ) : config = config or Config ( config_path ) port = port or config . worker_port import libscanner as bindings db = bindings . Database ( config . storage_config , config . db_path , master_address ) machine_params = machine_params or bindings . default_machine_params ( ) result = bindings . start_worker ( db , machine_params , str ( port ) . encode ( 'ascii' ) , watchdog ) if not result . success : raise ScannerException ( 'Failed to start worker: {}' . format ( result . msg ) ) if block : bindings . wait_for_server_shutdown ( db ) return result
Start a worker instance on this node.
Start a worker instance on this node .
"""
    Start a worker instance on this node.

    Args:
        master_address: The address of the master server to connect this worker
                        to.

    Kwargs:
        config: A scanner Config object. If specified, config_path is
                ignored.
        config_path: Path to a Scanner configuration TOML, by default
                     assumed to be `~/.scanner.toml`.
        block: If true, will wait until the server is shutdown. Server
               will not shutdown currently unless wait_ror_server_shutdown
               is eventually called.

    Returns:
        A cpp database instance.
    """ # Load all protobuf types #storage_config,
A cpp database instance.
A cpp database instance .
master_address
The address of the master server to connect this worker
to.
The address of the master server to connect this worker to .
machine_params
port
config
config_path
block
watchdog