The introduction of BodyParts again showed that not all entity types are
useful for every kind of context. There are now these contexts where
HttpEntities are used:
- requests
- responses
- body parts
And several kinds of entities:
- Strict
- Default
- Chunked
- CloseDelimited
- IndefiniteLength
To increase type safety of the API marker-interfaces are introduced defining
which kinds of entities can be used in which contexts:
- RequestEntity: Strict, Default, Chunked
- ResponseEntity: Strict, Default, Chunked, CloseDelimited
- BodyPartEntity: Strict, Default, IndefiniteLength
Also, to be able still to provide abstractions over some kinds of entities
additional auxiliary interfaces were necessary:
- MessageEntity = RequestEntity >: ResponseEntity: Strict, Default, Chunked (type alias for RequestEntity)
- UniversalEntity = RequestEntity with ResponseEntity with BodyPartEntity = Strict, Default
The most important changes from spray-routing:
- Change Route from `RequestContext => Unit` to `RequestContext => Deferrable[RouteResult]`
- Switch directive extraction model from shapeless HLists to plain Scala Tuples
- Switch API from promoting actors as Route "containers" to being powered by plain executors/flow-materializers
- Make `Directive0` re-execute inner routes per requests, refs spray/spray#780
Other fixes:
- Simplify unmarshalling infrastructure, now based on `Deferrable`, closes#15690
- Change marshalling infrastrucutre to be based on `Deferrable` as well
- Clean up `akka.http` package contents, closes#15689
Changing from HList-based extractions to Tuple-based ones comes with one important drawback:
We can't rely on type bounds anymore to tighten and auto-document the API where generic extractions handled.
Currently we therefore fall back to context bounds where they add value, but this might change if the added overhead or code complexity becomes too much. We'll see when the remaining parts of spray-routing are ported.
+ Makes reusing flows safe
+ Adds timerTransform for ops which need TimerTransformer
+ Adds TransformerLike in order to keep transform/timerTransform
typesafe in respect to the passed in type og Transformer
Resolves#15271
* implicit param
* change tests to use implicit materializer
* add ActorFlow trait that provides an implicit materializer inside an actor
in the right way, i.e. encourage usage of that instead of
implicit def mat(implicit arf: ActorRef): FlowMaterializer
* make http compile, but those who know the api better will have to adjust
to take full advantage of the implicit materializer
- add Logging trait for nicer interface
- add EventHandlerLogging class for offering the nice interface from
app.log
- add eventHandler instance to app and use that for all internal logging
(this means that some places (dispatchers, remoting) were infiltrated
by app just to do logging, but I think we'll need app in there soon
enough for other reasons)
someone should look at remoting vs. timeout (i.e. which is sent around),
because I removed that in some places. It might simply be irrelevant
once we remove the Future special-casing.
- removed SelfActorRef
- added an ActorContext interface that provides a view into ActorInstance
- the ActorInstance (as ActorContext) gets injected into the Actor
- moved self methods like sender and reply directly to the Actor