Fork decorator

decfork.fork(n)[source]

Decorator to fork a function many times.

Parameters:n (int) – number of forks to make.
Returns:None

Example

>>> from time import sleep
>>> @fork(n=3)
... def my_func_to_fork():
...     print('Starting...')
...     sleep(1)
...     print('done')
>>> my_func_to_fork()

will output

'Starting...'
'Starting...'
'Starting...'
'done'
'done'
'done'