You are here: Home / LBN / Up2date / Plone and Zope / BastionLinux 19 / zope-zc.thread-0.1.0-1.lbn19.noarch

zope-zc.thread-0.1.0-1.lbn19.noarch

Package Attributes
RPM  zope-zc.thread-0.1.0-1.lbn19.noarch.rpm Architecture  noarch Size  18688 Created  2019/09/30 06:52:52 UTC
Package Specification
Summary Thread-creation helper
Group Application/Internet
License ZPL
Home Page http://pypi.python.org
Description

The thread-creation API provided by the Python threading module is annoying. :)

This package provides a very simple thread-creation API that:

Makes threads daemonic and allows daemonicity to be passed to the constructor. For example:

zc.thread.Thread(mythreadfunc)

Starts a daemonic thread named mythreadfunc running mythreadfunc.

Allows threads to be defined via decorators, as in:

import zc.thread

@zc.thread.Thread def mythread(): ...

In the example above, a daemonic thread named mythread is created and started. The thread is also assigned to the variable mythread.

You can control whether threads are daemonic and wether they are started by default:

import zc.thread

@zc.thread.Thread(daemon=False, start=False) def mythread(): ...

After a thread finishes, you can get the return value of the target function from the thread's value attribute, or, if the function raises an exception, you can get the exception object from the thread's exception attribute. (This feature was inspired by the same feature in gevent greenlets.)

There's also a Process constructor/decorator that works like Thread, but with multi-processing processes, and without the value and exception attributes.

Requires
python-setuptools  
rpmlib(PayloadFilesHavePrefix)  
rpmlib(FileDigests)  
rpmlib(PartialHardlinkSets)  
rpmlib(CompressedFileNames)  
/bin/sh  
rpmlib(PayloadIsXz)  
Provides
zope-zc.thread

Document Actions