On 1 May 2017 at 12:13, NoxDaFox <[email protected]> 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
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to