Future, akka-stream, scalaz-stream

前半はFutureやExecutionContextの話で、 後半はdjspiewakさんが 「akka-streamはpushでscalaz-streamはpullモデルだ」 と発表したことに関してviktorklangさんが「そうじゃない」というところから議論始まってるのがポイント 続きを読む
2
Lgd. Viktor Klang @viktorklang

@djspiewak Re-running it I have not attempted. That sounds like it will become tricky. My point still stands tho, re "running computation".

2014-09-20 02:18:24
Daniel Spiewak @djspiewak

@viktorklang Well, if I could rephrase and qualify your point, it is that Future represents a computation who’s state is dependent on the EC

2014-09-20 02:20:48
Lgd. Viktor Klang @viktorklang

@djspiewak Or simply: A Future represents a value -in the future-.

2014-09-20 02:23:25
Lgd. Viktor Klang @viktorklang

@djspiewak Don't confuse it. Future.successful(something) is not a computation. val f = Promise[T]().future is not a computation.

2014-09-20 02:24:15
Daniel Spiewak @djspiewak

@viktorklang Ok, well I think it’s fair to say that a lot of people are using it as a model to control computation, perhaps not realizing

2014-09-20 02:25:09
Daniel Spiewak @djspiewak

@viktorklang So that’s the source of the misconception.

2014-09-20 02:25:22
Lgd. Viktor Klang @viktorklang

@djspiewak Computation is what links Futures to Futures—think map, flatMap, filter, whathaveyou. Just wanted to clear up the confusion.

2014-09-20 02:26:49
Lgd. Viktor Klang @viktorklang

@djspiewak On another topic, I think it's very interesting with lifted representations of transformation, there are tons of possibilities…

2014-09-20 02:33:33
Daniel Spiewak @djspiewak

@viktorklang @jessitron I’m pretty sure I could properly type the step function using Shapeless. It’s definitely crazy though. Easy in Idris

2014-09-20 03:21:29
Daniel Spiewak @djspiewak

@viktorklang @jessitron The problem is that the step function represents an arbitrary transition in a state machine, and he wants that typed

2014-09-20 03:22:24
Daniel Spiewak @djspiewak

@jessitron @viktorklang Actually, as @d6 pointed out to me, we did something very similar at Precog, and it was strongly typed.

2014-09-20 04:20:38
Daniel Spiewak @djspiewak

@jessitron @viktorklang So it’s not so much that the types would inhibit the idea. It’s more that types would inhibit Rich’s version.

2014-09-20 04:22:20
Lgd. Viktor Klang @viktorklang

@djspiewak Noooo, Akka streams is not a push model :( *cries on teh insidez* youtube.com/watch?feature=… It's a bounded dynamic push-pull.

2014-09-20 09:04:31
Daniel Spiewak @djspiewak

@viktorklang For the purposes of what I was describing, it’s mostly push. But yes, I’ve already been corrected on that one. :-)

2014-09-20 09:05:23
Daniel Spiewak @djspiewak

@viktorklang I believe I did give the disclaimer that I am very new to the space and know very little about the other options.

2014-09-20 09:07:00
Lgd. Viktor Klang @viktorklang

@djspiewak No worries. The fun thing with Akka Streams is that it automatically switches between push and pull depending on who is slower.

2014-09-20 09:10:01
Daniel Spiewak @djspiewak

@viktorklang Yeah, I think RxJava does the same. I prefer pure pull, but there’s no question that it doesn’t work as well for some things.

2014-09-20 09:10:58
Lgd. Viktor Klang @viktorklang

@djspiewak RxJava is doing the same (see reactive-streams.org), pull-based is bounded but allows for nothing but lock-step==inefficient.:(

2014-09-20 09:13:42
Daniel Spiewak @djspiewak

@viktorklang Look more closely at scalaz-stream. It’s not just lock step. :-)

2014-09-20 09:14:18
Daniel Spiewak @djspiewak

@viktorklang In fairness, when you use the scalaz-stream tools that allow racing and such, it does push-like things underneath.

2014-09-20 09:15:18
Lgd. Viktor Klang @viktorklang

@djspiewak Any particular pointers/links to see that? :)

2014-09-20 09:15:31
Daniel Spiewak @djspiewak

@viktorklang The general combinator is wye. One of the more useful variants is merge.mergeN. I talk about them in my presentation.

2014-09-20 09:16:46