sealed trait ProtocolStack[-Env, -IncomingIn, +IncomingOut, -OutgoingIn, +OutgoingOut] extends AnyRef
A zio.http.ProtocolStack represents a linear stack of protocol layers, each of which can statefully transform incoming and outgoing values of some handler.
Protocol stacks can be thought of as a formal model of the process of transforming one handler into another handler.
Protocol stacks are designed to support precise semantics around error handling. In particular, if a layer successfully processes an incoming value of a handler, then that same layer will also have a chance to process the outgoing value of the handler. This requirement constrains the ways in which layers can fail, and the types of handlers they may be applied to.
In particular, protocol stacks can be applied to handlers that fail with the same type as their output type. This guarantees that should a handler fail, it will still produce an outgoing value that can be processed by all the layers that successfully transformed the incoming value.
Further, a layer may only fail while it processes an incoming value, and it may only value with the same type as its outgoing value. This guarantees that should a layer fail, it will still produce an outgoing value that can be processed by all the earlier layers that successfully transformed the incoming value.
In a way, the entire design of protocol stacks is geared at ensuring layers that successfully process incoming values will also have a chance to process outgoing values.
The only composition operator on protocol stacks is ++, which simply chains
two stacks together. This operator is associative and has an identity (which
is the protocol stack that neither transforms incoming nor outgoing values,
and which acts as an identity when used to transform handlers).
- Self Type
- ProtocolStack[Env, IncomingIn, IncomingOut, OutgoingIn, OutgoingOut]
- Alphabetic
- By Inheritance
- ProtocolStack
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- abstract type State
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ++[Env1 <: Env, MiddleIncoming, MiddleOutgoing](that: ProtocolStack[Env1, IncomingOut, MiddleIncoming, MiddleOutgoing, OutgoingIn]): ProtocolStack[Env1, IncomingIn, MiddleIncoming, MiddleOutgoing, OutgoingOut]
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def apply[Env1 <: Env, Err >: OutgoingOut, IncomingOut1 >: IncomingOut, OutgoingIn1 <: OutgoingIn](handler: Handler[Env1, Err, IncomingOut1, OutgoingIn1])(implicit trace: Trace): Handler[Env1, Err, IncomingIn, OutgoingOut]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- lazy val incomingHandler: Handler[Env, OutgoingOut, IncomingIn, (State, IncomingOut)]
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def mapIncoming[IncomingOut2](f: (IncomingOut) => IncomingOut2): ProtocolStack[Env, IncomingIn, IncomingOut2, OutgoingIn, OutgoingOut]
- def mapOutgoing[OutgoingOut2](f: (OutgoingOut) => OutgoingOut2): ProtocolStack[Env, IncomingIn, IncomingOut, OutgoingIn, OutgoingOut2]
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- lazy val outgoingHandler: Handler[Env, Nothing, (State, OutgoingIn), OutgoingOut]
- def provideEnvironment(env: ZEnvironment[Env])(implicit trace: Trace): ProtocolStack[Any, IncomingIn, IncomingOut, OutgoingIn, OutgoingOut]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])