Package-level declarations
Types
This Flow will have behaviour very similar to SharedFlow, but there are several differences:
ExceptionHandler wrapper which was created to make possible to use handler across all coroutines calls
This key can (and will) be used to get ContextSafelyExceptionHandler from coroutineContext of suspend functions and in ContextSafelyExceptionHandler for defining of its CoroutineContext.Element.key
kotlinx.coroutines.flow.Flow-based android.view.ViewGroup.OnHierarchyChangeListener
It is interface which will work like classic Mutex, but in difference have lockStateFlow for listening of the SmartMutex state.
Functions
Creates AccumulatorFlow using this with receiveAsFlow to get
Creates AccumulatorFlow using this as base Flow
Planned to use with doWithSuspending. Will execute incoming lambdas sequentially
Planned to use with doWithSuspending. Will execute incoming lambdas sequentially
Call this method in case you need to do something in common thread (like reading of file in JVM)
Must be use with actor created by createActionsActor or createSafeActionsActor. Will send lambda which will execute action and return result.
This method will set new coroutineContext with ContextSafelyExceptionHandler. In case if coroutineContext already contains ContextSafelyExceptionHandler, ContextSafelyExceptionHandler.handler will be used BEFORE contextExceptionHandler in case of exception.
Shortcut for safely with exception handler, that as expected must return null in case of impossible creating of result from exception (instead of throwing it, by default always returns null)
Use ViewGroup.setOnHierarchyChangeListener recursively for all available ViewGroups starting with this. This extension DO NOT guarantee that recursive subscription will happen after this method call
Use subscribe, but all blocks will be called inside of safely function. Use onException to set up your reaction for Throwables
Use subscribeSafelyWithoutExceptions, but all exceptions inside of safely will be skipped
Use subscribeSafelyWithoutExceptions, but all exceptions will be passed to defaultSafelyExceptionHandler
Will wait until the SmartMutex.lockStateFlow of this instance will be false.
Will call SmartMutex.Mutable.lock, then execute action and return the result after SmartMutex.Mutable.unlock
Properties
This instance will be used in all calls of safely where exception handler has not been passed
This instance will be used in all calls of safelyWithoutExceptions as an exception handler for safely call
Use this handler in cases you wish to include handling of exceptions by defaultSafelyWithoutExceptionHandler and returning null at one time