Title: Make PyFunction implement java.util.concurrent.Callable
Type: Severity: normal
Components: Core Versions:
Status: open Resolution:
Dependencies: Superseder:
Assigned To: jamesmudd Nosy List: jamesmudd
Priority: normal Keywords:

Created on 2019-03-27.19:37:00 by jamesmudd, last changed 2019-03-27.19:37:00 by jamesmudd.

File name Uploaded Description Edit Remove jamesmudd, 2019-03-27.19:37:00 Example of using a PyFunction as a Callable
msg12404 (view) Author: James Mudd (jamesmudd) Date: 2019-03-27.19:36:59
To do this is easy we just need to froward the call method to the __call__ method.

It would be useful because all PyFunctions are Callable in the Java sense and it would be the first stage of allowing functions to be passed to Java methods as Callables.

See the attached example for how this could be used with Java executors and Futures.

Unfortunately this is not enough the MRO of puts ExecutorService.submit(Runnable) ahead of ExecutorService.submit(Callable<T>) so this would need to be resolved as well but if it was then the example could work as expected.
Date User Action Args
2019-03-27 19:37:00jamesmuddcreate