Last active
April 6, 2018 04:45
-
-
Save richdougherty/0a4d2124bff7a1a9db1676e5b4d92a05 to your computer and use it in GitHub Desktop.
Richer types for akka-grpc generated code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait GreeterService { | |
... | |
} | |
object GreeterService extends GreeterServiceCompanion[GreeterService] { | |
override val name = "helloworld.GreeterService" | |
... | |
} | |
class GreeterServiceClient(channel: Channel, options: CallOptions)(implicit mat: Materializer, ex: ExecutionContext) extends GreeterService { | |
... | |
} | |
object GreeterServiceClient extends GreeterServiceClientCompanion[GreeterService] { | |
override def apply(channel: Channel)(implicit mat: Materializer, ex: ExecutionContext): GreeterService = ... | |
... | |
} | |
object GreeterServiceHandler extends GreeterServiceHandlerCompanion[GreeterService] { | |
// I'm not sure if a PartialFunction is OK or if we want a richer return type for this method too. | |
override def apply(implementation: GreeterService)(implicit mat: Materializer): PartialFunction[HttpRequest, Future[HttpResponse]] = { | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment