def run(): Future[Http.ServerBinding] = {
implicit val sys = system
implicit val mat: Materializer = ActorMaterializer()
implicit val ec: ExecutionContext = sys.dispatcher
val service: HttpRequest => Future[HttpResponse] =
UsersServiceHandler(new UsersServiceImpl(mat))
val bound = Http().bindAndHandleAsync(
service,
interface = "
127.0.0.1",
port = 8080,
connectionContext = HttpConnectionContext(http2 = Always)
)
bound.foreach { binding =>
println(s"gRPC server bound to: ${binding.localAddress}")
}
bound
}