[Python-ideas] Decorators for running a function in a Process or Thread
Paul Moore
p.f.moore at gmail.com
Mon May 1 08:02:02 EDT 2017
More information about the Python-ideas mailing list
Mon May 1 08:02:02 EDT 2017
- Previous message (by thread): [Python-ideas] Decorators for running a function in a Process or Thread
- Next message (by thread): [Python-ideas] Decorators for running a function in a Process or Thread
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 1 May 2017 at 12:13, NoxDaFox <noxdafox at gmail.com> wrote: > > I think it could be a good fit for the `concurrent.futures` module. > Decorated functions would return a `Future` object and run the logic in a > separate thread or process. > > > @concurrent.futures.thread > def function(arg, kwarg=0): > return arg + kwarg > > future = function(1, kwarg=2) > future.result() What's the benefit over just running the function in a thread (or process) pool, using Executor.submit()? Paul
- Previous message (by thread): [Python-ideas] Decorators for running a function in a Process or Thread
- Next message (by thread): [Python-ideas] Decorators for running a function in a Process or Thread
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-ideas mailing list