Future#await() was initially meant to be called by a vertx virtual thread and reject any other thread. However this method can facilitate the workflow of synchrononous thread interacting with a vertx runtime, e.g. a unit test, from non-vertx threads.
Changes:
Change the implementation of Future#await() to permit non-vertx thread to block until the future completes. In addition a variant with a timeout has been added which can be useful for testing.
Motivation:
Future#await()
was initially meant to be called by a vertx virtual thread and reject any other thread. However this method can facilitate the workflow of synchrononous thread interacting with a vertx runtime, e.g. a unit test, from non-vertx threads.Changes:
Change the implementation of
Future#await()
to permit non-vertx thread to block until the future completes. In addition a variant with a timeout has been added which can be useful for testing.Results:
Any non-vertx thread can now await a future.