Class PythonCoercion.AsyncMemberAdapter
java.lang.Object
io.micronaut.context.python.PythonCoercion.AsyncMemberAdapter
- Enclosing class:
PythonCoercion
Adapter invoked from Python async member facades.
- Since:
- 5.2.0
-
Method Summary
Modifier and TypeMethodDescription@Nullable ObjectAdapt host values returned from Java members to values Python async code can consume.@Nullable org.graalvm.polyglot.ValueadaptAwaitable(org.graalvm.polyglot.Context context, @Nullable Object value) Adapt a host async value returned from a Java member to a Python awaitable.@Nullable org.graalvm.polyglot.ValueadaptAwaitable(org.graalvm.polyglot.Context context, @Nullable Object value, @Nullable PythonReactiveContext reactiveContext) Adapt a host async value returned from a Java member to a Python awaitable; a publisher is subscribed within the reactive context of the awaiting coroutine, so the Reactor context of the subscriber that started the coroutine (a reactive transaction status, for instance) reaches it.
-
Method Details
-
adapt
-
adaptAwaitable
public @Nullable org.graalvm.polyglot.Value adaptAwaitable(org.graalvm.polyglot.Context context, @Nullable Object value) Adapt a host async value returned from a Java member to a Python awaitable.- Parameters:
context- The target Python context.value- The host value.- Returns:
- The adapted Python awaitable, or null when the value is not async.
-
adaptAwaitable
public @Nullable org.graalvm.polyglot.Value adaptAwaitable(org.graalvm.polyglot.Context context, @Nullable Object value, @Nullable PythonReactiveContext reactiveContext) Adapt a host async value returned from a Java member to a Python awaitable; a publisher is subscribed within the reactive context of the awaiting coroutine, so the Reactor context of the subscriber that started the coroutine (a reactive transaction status, for instance) reaches it.- Parameters:
context- The target Python context.value- The host value.reactiveContext- The reactive context of the coroutine, ornullfor none.- Returns:
- The adapted Python awaitable, or null when the value is not async.
-