Skip to content

Instantly share code, notes, and snippets.

@ktoso
Created February 13, 2015 11:45
Show Gist options
  • Select an option

  • Save ktoso/ea102aafdadf1779f4ac to your computer and use it in GitHub Desktop.

Select an option

Save ktoso/ea102aafdadf1779f4ac to your computer and use it in GitHub Desktop.
object Fair {
final case class Ports[T]() extends FlexiPorts[T](name = "Fair") {
val input1 = createInputPort[T]()
val input2 = createInputPort[T]()
}
final case class Logic[T]() extends FlexiMerge[T, Ports[T]](Ports()) {
val readAny = State[T](ReadAny(ports.input1, ports.input2)) { (ctx, input, element) ⇒
ctx.emit(element)
SameState
}
override def initialState = readAny
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment