Skip to content

Instantly share code, notes, and snippets.

@dorsev
Created December 1, 2018 21:52
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/ae0ce89ab51766a1ae2b76f5f55c0ae9 to your computer and use it in GitHub Desktop.
Save dorsev/ae0ce89ab51766a1ae2b76f5f55c0ae9 to your computer and use it in GitHub Desktop.
trait Gauge {
def set(off: Long): Unit
}
val gauge: Gauge = ???
val counter: AtomicLong = ???
def offsetMonitor[A](monitor: Long=>Unit) =
monitor(12)
offsetMonitor(gauge.set _)
offsetMonitor(counter.set _)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment