-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve documentation for fan in operators #26
Comments
Btw I'm getting an exception when trying to build the docs. I don't see what's wrong. When running
|
The problem is that the swave docs actually depend on sbt-paradox version 0.2.9 but the sbt-site plugin is not yet compatible with that release. If you want to build the docs locally right now you need to:
|
FYI @eed3si9n about the incompatibility between paradox and sbt-site |
Tx @sirthias I'll do that for now. Wrt the documentation: I've tried to come up with one liner descriptions that are as intuïtive as possible. (since a lot of descriptions of streaming operators read like temporal legalese)
What do you think: are those the most important semantic differences between those operators? |
@joost-de-vries There are more factors that differentiate fan-in transformations. This page in the docs tries to highlight them. The reason that "descriptions of streaming operators read like temporal legalese" is that it's truly not as simple as "and" or "or". Apart from how they treat incoming elements the transformation also differ in when they do it. And there is the question of how and when they request from their upstreams and when they complete to downstream. One guideline could be the Akka documentation. Here is their documentation for fan-ins. Their structure is (general description, emits, backpressures, completes), which I would improve to (general description, requests from upstream, emits to downstream, completes to downstream), so very similar but turning "backpressures" from its head on its toes. |
Yeah, I agree that the 'temporal legalese' is necessary. The way I understand it is that a given stream has a semantic that could be informally expressed as It's just that for a user of Swave I thought it would be nice to to have a short description per operator. Before diving into the temporal legalese of a single operator. Currently I have this
As you can tell I wasn't sure about |
A short description per operator definitely makes sense. How about something like this?:
The main difference to your proposal would be "elements" instead of "events" and "upstreams" instead of "inputs". WDYT? |
That looks very clear. Are you purely targeting Shapeless developers? Because most Scala developers are lost when one starts talking about Coproducts and sum types... |
swave doesn't only target shapeless developers. I think you don't need any knowledge of shapeless in order to be able to use it effectively. In order to understand final def mergeToEither[B](right: Spout[B]): Repr[Either[A, B]] =
map(Left[A, B]).attach(right.map(Right[A, B])).fanInToSum[Either[A, B]]() So, suppose you have this ADT: sealed trait Animal
case class Cat(name: String) extends Animal
case class Dog(name: String) extends Animal
case object LastUnicorn extends Animal then you can merge three upstreams with type |
I guess the difference between I'll make a beginning with writing those. |
Here's my proposal for the fanOut oneliners:
|
Yes, that's right.
I agree but I don't think we have to do anything about it.
Absolutely. This has been my goal all along... |
I've created a PR of the ongoing doc improvement. |
The first step is for this doc page to describe what the individual operators do.
The text was updated successfully, but these errors were encountered: