Skip to content

Instantly share code, notes, and snippets.

@dorsev
Last active December 1, 2018 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dorsev/3f2baa00bacf8ff26f68004ae2959a3b to your computer and use it in GitHub Desktop.
Save dorsev/3f2baa00bacf8ff26f68004ae2959a3b to your computer and use it in GitHub Desktop.
def offsetMonitor[F[_]: Functor, E, H[_]: Functor, T](
monitor: H[{def set(offset:Long):Unit}]
): Flow[EnvT[E, F, ProducerResult[T]], EnvT[E, F, ProducerResult[T]], NotUsed] =
Flow[EnvT[E, F, ProducerResult[T]]].map { elem =>
elem.map { e =>
monitor.map { m =>
m.set(e.env.offset)
}
}
elem
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment