Skip to content

Commit

Permalink
Added API docs for GrpcChannel.
Browse files Browse the repository at this point in the history
  • Loading branch information
drmontgomery committed May 9, 2022
1 parent b8acaad commit d4617f2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions runtime/src/main/scala/akka/grpc/GrpcChannel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,31 @@ final class GrpcChannel private (

Grpc(sys).registerChannel(this)

/**
* Java API: Initiates a shutdown in which preexisting and new calls are cancelled.
*/
def closeCS(): CompletionStage[Done] =
close().toJava

/**
* Java API: Returns a CompletionStage that completes successfully when channel is shut down via close(),
* or exceptionally if connection cannot be established or reestablished after maxConnectionAttempts.
*/
def closedCS(): CompletionStage[Done] =
closed().toJava

/**
* Scala API: Initiates a shutdown in which preexisting and new calls are cancelled.
*/
def close(): Future[akka.Done] = {
Grpc(sys).deregisterChannel(this)
ChannelUtils.close(internalChannel)
}

/**
* Scala API: Returns a Future that completes successfully when channel is shut down via close()
* or exceptionally if a connection cannot be established or reestablished after maxConnectionAttempts.
*/
def closed(): Future[akka.Done] =
internalChannel.done
}
Expand Down

0 comments on commit d4617f2

Please sign in to comment.