def join(self, timeout=3.0): self._log.debug("joining") if self._req_socket is not None: self._req_socket.close() self._req_socket = None Greenlet.join(self, timeout) self._log.debug("join complete")
def join(self, timeout=3.0): """ Clean up and wait for the greenlet to shut down """ self._log.debug("joining") self._pull_socket.close() Greenlet.join(self, timeout) self._log.debug("join complete")
def join(self, timeout=3.0): self._log.debug("joining") Greenlet.join(self, timeout) self._dealer_socket.close() self._log.debug("join complete")
def join(self, timeout=None): self._log.debug("joining") self._halt_event.set() Greenlet.join(self, timeout) self._log.debug("join complete")
def join(self, timeout=None): self._log.info("joining") Greenlet.join(self, timeout)
# In[ ]: # Creating a simple function and wrapping it in greenlet def myfunction(arg1, arg2, **kwargs): print(arg1, arg2, kwargs) return 100 # In[ ]: g = Greenlet(myfunction, 'One', 'Two', now='Buckle my shoe') # create a Greenlet instance using c'tor g.start( ) # and then call start(), which immediately calls it, returns None always g.join() print('Finished') print('Greenlet.value', g.value) # Stores the function return value # In[ ]: # the other way is to use the spawn() method, which creates an instance and calls start() too. # So it is a shorthand and widely used jobs = [ gevent.spawn(myfunction, '1', '2', now='Buckle my shoe') for i in range(0, 5) ] gevent.joinall( jobs, timeout=3 ) # the first parameter is reduced to a subset of jobs that finished under 3 seconds [job.value for job in jobs]
def close(self, workers: Greenlet) -> None: workers.join() result = self._format_result(worker=workers) self._GreenThread_Running_Result.append(result)