swingutils.threads.coroutine

A coroutine mechanism that uses the AWT event loop.

swingutils.threads.coroutine.returnValue(result)

Returns a value from an @swingCoroutine function. Since they are generators, a normal return statement can’t be used on Jython 2.x.

swingutils.threads.coroutine.swingCoroutine(func)

Enables the wrapped generator function to pause execution when it needs a Future to be completed to continue. The wrapped function is guaranteed to run on the AWT event dispatch thread. To return a value from it on Jython 2, call returnValue() instead of using the return statement.

If there is unhandled exception in the wrapped method and the future returned from the wrapper has no listener callbacks, the default coroutine exception handler is invoked.