-
- All Implemented Interfaces:
public final class KeyedSingleSharedFlowKt
-
-
Method Summary
Modifier and Type Method Description final static KeyedSingleSharedFlowContextkeyedSingleSharedFlow(Mutex mutex, Map<String, KeyedSingleSharedFlowContainer<?>> map)Create a new KeyedSingleSharedFlowContext object final static <T extends Any> TwithSingleShared(CoroutineContext context, String key, SuspendFunction0<T> block)Hot-invoke specified suspending function by unique key final static <T extends Any> Flow<T>withSingleSharedFlow(CoroutineContext context, String key, SuspendFunction0<T> block)Hot-invoke specified suspending function with convert to flow by unique key final static <T extends Any> Flow<T>shareSingleBy(Flow<T> $self, CoroutineContext context, String key)Hot-invoke original flow by unique key -
-
Method Detail
-
keyedSingleSharedFlow
final static KeyedSingleSharedFlowContext keyedSingleSharedFlow(Mutex mutex, Map<String, KeyedSingleSharedFlowContainer<?>> map)
Create a new KeyedSingleSharedFlowContext object
-
withSingleShared
final static <T extends Any> T withSingleShared(CoroutineContext context, String key, SuspendFunction0<T> block)
Hot-invoke specified suspending function by unique key
- Parameters:
context- CoroutineContext to execute sharing flowkey- unique key to use hot-invoke a specified suspending functionblock- suspending function to invoke
-
withSingleSharedFlow
@Deprecated(message = "Use Flow<T>.singleShareIn", replaceWith = @ReplaceWith(imports = {"kotlinx.coroutines.flow.asFlow"}, expression = "block.asFlow().singleShareBy(context, key)")) final static <T extends Any> Flow<T> withSingleSharedFlow(CoroutineContext context, String key, SuspendFunction0<T> block)
Hot-invoke specified suspending function with convert to flow by unique key
- Parameters:
context- CoroutineContext to execute sharing flowkey- unique key to use hot-invoke a specified flowblock- suspending function to invoke
-
shareSingleBy
final static <T extends Any> Flow<T> shareSingleBy(Flow<T> $self, CoroutineContext context, String key)
Hot-invoke original flow by unique key
- Parameters:
context- CoroutineContext to execute sharing flowkey- unique key to use hot-invoke a specified flow
-
-
-
-