I hereby claim:
- I am rocketpages on github.
- I am kvnwbbr (https://keybase.io/kvnwbbr) on keybase.
- I have a public key whose fingerprint is A584 324C 87CD 0C37 2CB1 FB51 1799 9823 161C B8E8
To claim this, I am signing this object:
| public class App | |
| { | |
| public static void main(String[] args) | |
| { | |
| // The main collection | |
| Collection<Visitable> visitables = new ArrayList<Visitable>(); | |
| visitables.add(new VisitableInteger(5)); | |
| visitables.add(new VisitableString("Kevin")); | |
| visitables.add(new VisitableInteger(17)); |
| def getAvailabilities(date: Date, length: String): Seq[AvailableTime] = { | |
| val at = AvailableTime(None, new Date(System.currentTimeMillis()), "10", "30") | |
| val at2 = AvailableTime(None, new Date(System.currentTimeMillis()), "10", "45") | |
| val at3 = AvailableTime(None, new Date(System.currentTimeMillis()), "11", "15") | |
| val at4 = AvailableTime(None, new Date(System.currentTimeMillis()), "14", "30") | |
| val at5 = AvailableTime(None, new Date(System.currentTimeMillis()), "15", "45") | |
| val at6 = AvailableTime(None, new Date(System.currentTimeMillis()), "16", "15") | |
| val at7 = AvailableTime(None, new Date(System.currentTimeMillis()), "17", "30") | |
| val times = Seq(at, at2, at3, at4, at5, at6, at7) |
| def getAvailabilities(date: Date, length: String): Seq[AvailableTime] = { | |
| val at = AvailableTime(None, new Date(System.currentTimeMillis()), "10", "30") | |
| val at2 = AvailableTime(None, new Date(System.currentTimeMillis()), "10", "45") | |
| val at3 = AvailableTime(None, new Date(System.currentTimeMillis()), "11", "15") | |
| val at4 = AvailableTime(None, new Date(System.currentTimeMillis()), "14", "30") | |
| val at5 = AvailableTime(None, new Date(System.currentTimeMillis()), "15", "45") | |
| val at6 = AvailableTime(None, new Date(System.currentTimeMillis()), "16", "15") | |
| val at7 = AvailableTime(None, new Date(System.currentTimeMillis()), "17", "30") | |
| val times = Seq(at, at2, at3, at4, at5, at6, at7) |
| def getAvailabilities(date: Date, length: String): Seq[AvailableTime] = { | |
| val at = AvailableTime(None, new Date(System.currentTimeMillis()), "10", "30") | |
| val at2 = AvailableTime(None, new Date(System.currentTimeMillis()), "10", "45") | |
| val at3 = AvailableTime(None, new Date(System.currentTimeMillis()), "11", "15") | |
| val at4 = AvailableTime(None, new Date(System.currentTimeMillis()), "14", "30") | |
| val at5 = AvailableTime(None, new Date(System.currentTimeMillis()), "15", "45") | |
| val at6 = AvailableTime(None, new Date(System.currentTimeMillis()), "16", "15") | |
| val at7 = AvailableTime(None, new Date(System.currentTimeMillis()), "17", "30") | |
| val times = Seq(at, at2, at3, at4, at5, at6, at7) |
I hereby claim:
To claim this, I am signing this object:
| object GraphExample { | |
| import akka.actor.ActorSystem | |
| import akka.stream.ActorMaterializer | |
| import akka.stream.scaladsl._ | |
| import FlowGraph.Implicits._ | |
| import scala.util.{ Failure, Success } | |
| import scala.concurrent.ExecutionContext.Implicits._ | |
| implicit val system = ActorSystem("Sys") | |
| implicit val materializer = ActorMaterializer() |
| in ~> f1 ~> bcast ~> f2 ~> merge ~> f3 ~> out | |
| bcast ~> f4 ~> merge |
| public interface Processor<T, R> extends Subscriber<T>, Publisher<R> {} | |
| public interface Publisher<T> { | |
| public void subscribe(Subscriber<? super T> s); | |
| } | |
| public interface Subscriber<T> { | |
| public void onSubscribe(Subscription s); | |
| public void onNext(T t); | |
| public void onError(Throwable t); |
| implicit val actorSystem = ActorSystem("ReactiveKafka") | |
| implicit val materializer = ActorMaterializer() | |
| val kafka = new ReactiveKafka(host = "localhost:9092", zooKeeperHost = "localhost:2181") | |
| val publisher = kafka.consume("lowercaseStrings", "groupName", new StringDecoder()) | |
| val subscriber = kafka.publish("uppercaseStrings", "groupName", new StringEncoder()) | |
| // consume lowercase strings from kafka and publish them transformed to uppercase | |
| Source(publisher).map(_.toUpperCase).to(Sink(subscriber)).run() |
| val decider: Supervision.Decider = exc => exc match { | |
| case _: ArithmeticException => Supervision.Resume | |
| case _ => Supervision.Stop | |
| } | |
| // ActorFlowMaterializer takes the list of transformations comprising a akka.stream.scaladsl.Flow | |
| // and materializes them in the form of org.reactivestreams.Processor | |
| implicit val mat = ActorFlowMaterializer( | |
| ActorFlowMaterializerSettings(system).withSupervisionStrategy(decider)) | |
| val source = Source(0 to 5).map(100 / _) | |
| val result = source.runWith(Sink.fold(0)(_ + _)) |