This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vxgmichel
Recipients Yury.Selivanov, gvanrossum, python-dev, r.david.murray, vstinner, vxgmichel, yselivanov
Date 2015-10-05.16:12:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1444061559.1.0.711185040308.issue25304@psf.upfronthosting.co.za>
In-reply-to
Content
I attached the first version of the documentation for `run_coroutine_threadsafe`. The `Concurrency and multithreading` section also needs to be updated but I could already use some feedback.

Also, I think we should add a `try-except` in the callback function, especially since users can set their own task factory. For instance:
  
loop.set_task_factory(lambda loop, coro: i_raise_an_exception)

will cause the future returned by `run_coroutine_threadsafe` to wait forever. Instead, we could have:

    except Exception as exc:
        if future.set_running_or_notify_cancel():
            future.set_exception(exc)

inside the callback to notify the future.
History
Date User Action Args
2015-10-05 16:12:39vxgmichelsetrecipients: + vxgmichel, gvanrossum, vstinner, r.david.murray, Yury.Selivanov, python-dev, yselivanov
2015-10-05 16:12:39vxgmichelsetmessageid: <1444061559.1.0.711185040308.issue25304@psf.upfronthosting.co.za>
2015-10-05 16:12:39vxgmichellinkissue25304 messages
2015-10-05 16:12:39vxgmichelcreate