From 6a062f1d914dc6fec2b53b6c1bb275cfd0d6588d Mon Sep 17 00:00:00 2001 From: niqdev Date: Wed, 15 Nov 2017 19:00:59 +0000 Subject: [PATCH] pitchme: update presentation --- PITCHME.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/PITCHME.md b/PITCHME.md index 80d7726..deb63f9 100644 --- a/PITCHME.md +++ b/PITCHME.md @@ -259,20 +259,21 @@ package object stream { case class Throttle(sleepMillis: Long) extends FlowControl } trait MonitorStream { + def entityToEventFlow[E]: + Flow[Either[LeftMetadata, E], (Event, String), _] = ??? + def monitorEventActorFlow(monitorActor: ActorRef)(implicit ...): + Flow[(Event, String), FlowControl, _] = ??? def controlDynamicFlow: Flow[FlowControl,FlowControl,NotUsed] = Flow[FlowControl] flatMapConcat { - case c@Continue => - Source.single(c) - case t@Throttle(sleepMillis) => - Source.single(t) - .delay(sleepMillis, DelayOverflowStrategy.backpressure) - } -} + case c@Continue => Source.single(c) + case t@Throttle(sleepMillis) => Source.single(t) + .delay(sleepMillis, DelayOverflowStrategy.backpressure) }} ``` @[1-5] -@[6-7, 15] -@[8-14] +@[7-8] +@[9-10] +@[11-15] +++ @@ -338,7 +339,7 @@ Benefits - any step can fail: `Either[LeftMetadata, T]` - simple to test - DRY: easy to abstract and reuse streams -- use `async` and custom `dispatcher` +- use `async` and custom `dispatcher` to increase speed more tha 10 times - back-pressure - it's fun!