* Fold Tap/Drain into Source/Sink
* Create Source/Sink helpers to create all Sources/Sinks
* Make concrete Source/Sink implementations private[scaladsl2]
This replaces the awkward post-processing previously done with RequestContext.finish and
prevents the loop-hole of Future.failed which previously allowed errors
to be missed by the current ExceptionHandler.
Unfortunately implicit resolution evaluates type boundaries only quite late in the resolution process which can lead to fake implicit diversions errors. Getting rid of the type boundary here make debugging Unmarshaller type class problem easier.
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