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.