loky/backend/managers.py
def start(self, initializer=None, initargs=()):
        '''Spawn a server process for this manager object'''
        assert self._state.value == State.INITIAL

        if (initializer is not None
                and not hasattr(initializer, '__call__')):
            raise TypeError('initializer must be a callable')

        # pipe over which we will retrieve address of server
        reader, writer = mp.Pipe(duplex=False)

        # spawn process which runs a server
        self._process = Process(
            target=type(self)._run_server,
            args=(self._registry, self._address, bytes(self._authkey),
                  self._serializer, writer, initializer, initargs),
        )
        ident = ':'.join(str(i) for i in self._process._identity)
        self._process.name = type(self).__name__ + '-' + ident
        self._process.start()

        # get address of server
        writer.close()
        self._address = reader.recv()
        reader.close()

        # register a finalizer
        self._state.value = State.STARTED
        self.shutdown = mp.util.Finalize(
            self, type(self)._finalize_manager,
            args=(self._process, self._address, self._authkey,
                  self._state, self._Client),
            exitpriority=0
        )
def start(self, initializer=None, initargs=()):
        '''Spawn a server process for this manager object'''
        assert self._state.value == State.INITIAL

        if (initializer is not None
                and not hasattr(initializer, '__call__')):
            raise TypeError('initializer must be a callable')

        # pipe over which we will retrieve address of server
        reader, writer = mp.Pipe(duplex=False)

        # spawn process which runs a server
        self._process = Process(
            target=type(self)._run_server,
            args=(self._registry, self._address, bytes(self._authkey),
                  self._serializer, writer, initializer, initargs),
        )
        ident = ':'.join(str(i) for i in self._process._identity)
        self._process.name = type(self).__name__ + '-' + ident
        self._process.start()

        # get address of server
        writer.close()
        self._address = reader.recv()
        reader.close()

        # register a finalizer
        self._state.value = State.STARTED
        self.shutdown = mp.util.Finalize(
            self, type(self)._finalize_manager,
            args=(self._process, self._address, self._authkey,
                  self._state, self._Client),
            exitpriority=0
        )
def start ( self , initializer = None , initargs = ( ) ) : assert self . _state . value == State . INITIAL if ( initializer is not None and not hasattr ( initializer , '__call__' ) ) : raise TypeError ( 'initializer must be a callable' ) # pipe over which we will retrieve address of server reader , writer = mp . Pipe ( duplex = False ) # spawn process which runs a server self . _process = Process ( target = type ( self ) . _run_server , args = ( self . _registry , self . _address , bytes ( self . _authkey ) , self . _serializer , writer , initializer , initargs ) , ) ident = ':' . join ( str ( i ) for i in self . _process . _identity ) self . _process . name = type ( self ) . __name__ + '-' + ident self . _process . start ( ) # get address of server writer . close ( ) self . _address = reader . recv ( ) reader . close ( ) # register a finalizer self . _state . value = State . STARTED self . shutdown = mp . util . Finalize ( self , type ( self ) . _finalize_manager , args = ( self . _process , self . _address , self . _authkey , self . _state , self . _Client ) , exitpriority = 0 )
Spawn a server process for this manager object
Spawn a server process for this manager object