WIP: derive http client from service #368
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a work in progress to track the status of HTTP client derivation from service protocol (protocol = service annotated trait). The actual implementation:
http
object within the generated companionHttpClient[F[_]: Sync]
inside thehttp
objectHttpClient
for each@http
annotated method in the protocol, with all the needed.Some assumptions/questions I've taken while implementing this:
@http
annotation, to try to leave the method as similar to the RPC definition as possible. Otherwise, i haven't found a solution for that, since it'll make method incompatible with RPC...Test
To see generated code, I've used this file
And loaded directly in the REPL:
$ sbt client/console scala> :load test.scala