Package Bio :: Package MultiProc :: Module copen
[show private | hide private]
[frames | no frames]

Module Bio.MultiProc.copen

This implements a set of classes that wraps a file object interface around code that executes in another process. This allows you fork many different commands and let the run concurrently.

Functions: copen_sys Open a file-like pipe to a system command. copen_fn Open a file-like pipe to a python function.
Classes
_PickleHandle Members: pid what is the PID of the subprocess? killsig what signal killed the child process? status what was the status of the command?
_ProcHandle This object provides a file-like interface to a running process.

Function Summary
  copen_fn(func, *args, **keywords)
copen_fn(func, *args, **keywords) -> file-like object
  copen_sys(syscmd, *args)
copen_sys(syscmd, *args) -> file-like object
  _cleanup()
Close all active commands.
  _handle_sigterm(signum, stackframe)
Handles a SIGTERM.

Variable Summary
int _HANDLING = 0                                                                     
int _PREV_SIGTERM = 0                                                                     

Function Details

copen_fn(func, *args, **keywords)

copen_fn(func, *args, **keywords) -> file-like object

Open a file-like object that returns the output from function call. The object's 'read' method returns the return value from the function. The function is executed as a separate process so any variables modified by the function does not affect the ones in the parent process. The return value of the function must be pickle-able.

copen_sys(syscmd, *args)

copen_sys(syscmd, *args) -> file-like object

Open a file-like object that returns the output from a system command.

_cleanup()

Close all active commands.

_handle_sigterm(signum, stackframe)

Handles a SIGTERM. Cleans up.

Variable Details

_HANDLING

Type:
int
Value:
0                                                                     

_PREV_SIGTERM

Type:
int
Value:
0                                                                     

Generated by Epydoc 2.1 on Thu Aug 10 20:05:46 2006 http://epydoc.sf.net