=> operator does not work in place of Via
See original GitHub issueopen Akka
open Akka.Actor
open Akka.Streams
open Akka.Streams.Dsl
open Akkling
open Akkling.Streams
open Akkling.Streams.Operators
type IUser = interface end
type IHashtagEntity = interface end
type ITweet =
abstract Hashtags: IHashtagEntity list
abstract CreatedBy: IUser
[<EntryPoint>]
let main _ =
use system = ActorSystem.Create("test")
let mat = system.Materializer()
GraphDsl.Create (fun b ->
let broadcast = b.Add(Broadcast<ITweet>(2))
b.From(broadcast.Out(0)).Via(Flow.id |> Flow.map (fun (tweet: ITweet) -> tweet.CreatedBy)) |> ignore
b.From(broadcast.Out(0)) => (Flow.id |> Flow.map (fun (tweet: ITweet) -> tweet.CreatedBy)) |> ignore
ClosedShape.Instance
)
|> RunnableGraph.FromGraph
|> Graph.run mat
|> ignore
0
I expect Flow<ITweet, IUser, NotUsed>
here instead of Flow<ITweet, ITweet, NotUsed>
.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Why don't C++ compilers define operator== and operator!
I personally consider it unfortunate that copy operations are defined by default and I prohibit copying of objects of many of my classes....
Read more >pipe operator not working - General
The pipe operator is not working. I get this error message, (could not find function "%>%"). I have installed and loaded tidyverse.
Read more >Not equal to comparison operator does not work
I have a list of opportunities that I fetched via SOQL query. I am trying to check if any of the fetched opportunities...
Read more >`Like` operator does not work for internal tables · Issue #3386
When using a filter on a Data Provider , with internal tables, the Like operator does not work. It works fine on SQL....
Read more >JQL operators | Jira Software Cloud
The "WAS NOT IN" operator is used to search for issues where the value of the specified field has never been one of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If you have
Broadcast(1)
, then you don’t need broadcast at all.Think of stages as building blocks with inputs and outputs. Graph.create requies you to either join all of them together (so that there are no dangling in-/outputs), or expose them outside:
Flow.id |> Flow.map (..) |> ignore
is not closed, as output of Flow.map is still dangling around (just ignored). AfterVia
call, it needs to be connected i.e. toSink.ignore
stage (if you don’t want to do anything with it).SinkShape<_>(broadcast.In)
, which will produce a sink. You can then connect that sink with the source of your choice to materialize it into fully functioning graph.You may also want to take a look at the example of using Akkling graph API.
I’m not sure right now, but I guess, that the current definition of
=>
may have been not precise enough, and F# type inference gone to the wrong conclusion. So far I still struggle to make Graph DSL F#-friendly.Unfortunately original Akka GraphDSL uses almost all scala-specific features in one place (implicit params, implicit type casting, custom operators with multiple overloads etc.). It’s hard to create something remotely similar in any other language.