package annotations
Type Members
- class Unsafe extends Annotation with StaticAnnotation
An annotation meant to warn users on unsafe functions.
An annotation meant to warn users on unsafe functions.
"Unsafe" can include behavior such as:
- breaking of referential transparency, see UnsafeBecauseImpure
- blocking the underlying thread, see UnsafeBecauseBlocking
- exposing a protocol of communication that has to be used as specified or otherwise the behavior can be undefined, see UnsafeProtocol
- class UnsafeBecauseBlocking extends Unsafe
An annotation meant to warn users on functions that are triggering blocking operations.
An annotation meant to warn users on functions that are triggering blocking operations.
Blocking threads is unsafe because:
- the user has to be aware of the configuration of the underlying thread-pool, which should be preferably unbounded, or otherwise it can suffer from thread starvation
- it's not supported on top of JavaScript
Prefer to avoid blocking operations.
- class UnsafeBecauseImpure extends Unsafe
An annotation meant to warn users on functions that are breaking referential transparency.
An annotation meant to warn users on functions that are breaking referential transparency.
Such operations are unsafe in a context where purity is expected. Note however that most data types defined in
monix.execution
are impure. - class UnsafeProtocol extends Unsafe
An annotation meant to warn users on functions that are using an error prone protocol.
An annotation meant to warn users on functions that are using an error prone protocol.
An example of such a protocol is the one defined at reactive-streams.org, being unsafe because its safe usage requires deep knowledge of it, having lots of cases in which the compiler does not and cannot help, leading to undefined behavior if not careful.
Only use such functions if familiar with the underlying protocol.
This is the API documentation for the Monix library.
Package Overview
monix.execution exposes lower level primitives for dealing with asynchronous execution:
Atomic
types, as alternative tojava.util.concurrent.atomic
monix.catnap exposes pure abstractions built on top of the Cats-Effect type classes:
monix.eval is for dealing with evaluation of results, thus exposing Task and Coeval.
monix.reactive exposes the
Observable
pattern:Observable
implementationsmonix.tail exposes Iterant for purely functional pull based streaming:
Batch
andBatchCursor
, the alternatives to Scala'sIterable
andIterator
respectively that we are using within Iterant's encodingYou can control evaluation with type you choose - be it Task, Coeval, cats.effect.IO or your own as long as you provide correct cats-effect or cats typeclass instance.