Details
-
Enhancement
-
Status: Closed
-
P4
-
Resolution: Future Project
-
None
-
None
-
generic
-
generic
Description
A DESCRIPTION OF THE PROBLEM :
At the moment, only the Thread.ofVirtual() function exists, which always runs continuations on the internal ForkJoinPool. However, being able to pass in a custom executor opens a very interesting possibilities:
1. Ability to run continuations on the UI thread, thereby having the possibility of having a long-running UI operation. The operation would be able to block, without obstructing the "UI event queue" to run. Please read more here: https://mvysny.github.io/vaadin-blocking-dialogs/
2. Ability to create Python-like generators. Prototyped here: https://github.com/mvysny/vaadin-loom/blob/bda351b727dbabe8473718d6da87537e96b33ad6/src/main/java/com/vaadin/starter/skeleton/loom/Iterators.java#L130
At the moment, only the Thread.ofVirtual() function exists, which always runs continuations on the internal ForkJoinPool. However, being able to pass in a custom executor opens a very interesting possibilities:
1. Ability to run continuations on the UI thread, thereby having the possibility of having a long-running UI operation. The operation would be able to block, without obstructing the "UI event queue" to run. Please read more here: https://mvysny.github.io/vaadin-blocking-dialogs/
2. Ability to create Python-like generators. Prototyped here: https://github.com/mvysny/vaadin-loom/blob/bda351b727dbabe8473718d6da87537e96b33ad6/src/main/java/com/vaadin/starter/skeleton/loom/Iterators.java#L130