Skip to content

Commit

Permalink
code golf
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Sep 25, 2024
1 parent 7af9d69 commit aea879f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/main/scala/netty/ActorChannelConnector.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@ final private class ActorChannelConnector(
def apply(endpoint: Endpoint, channel: Channel): Unit =
val clientPromise = Promise[Client]()
channel.attr(key.client).set(clientPromise.future)
val channelEmit: ClientEmit =
emitToChannel(channel, withFlush = endpoint.alwaysFlush)
val monitoredEmit: ClientEmit = (msg: ipc.ClientIn) =>
val channelEmit: ClientEmit = (msg: ipc.ClientIn) =>
endpoint.emitCounter.increment()
channelEmit(msg)
clients ! Clients.Control.Start(endpoint.behavior(monitoredEmit), clientPromise)
emitToChannel(channel, withFlush = endpoint.alwaysFlush)
clients ! Clients.Control.Start(endpoint.behavior(channelEmit), clientPromise)
channel.closeFuture.addListener:
new GenericFutureListener[NettyFuture[Void]]:
def operationComplete(f: NettyFuture[Void]): Unit =
Expand Down

0 comments on commit aea879f

Please sign in to comment.