Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing Scala Actors to create sth like a Pipeline
    primarykey
    data
    text
    <p>I am struggling with the following problem for a week by now and need some advice.</p> <pre><code>def query(title: String): List[Search] // query("Terminator") =&gt; ["Terminator I", "Terminator II", "Terminator 1984", etc...] def searchIMDB(s: Search): List[SearchResult] def searchTMDB(s: Search): List[SearchResult] def filterRedundantSearchResults(sr: SearchResult): Option[SearchResult] def fetchIMDB(sr: SearchResult): List[MetaInfo] def fetchTMDB(sr: SearchResult): List[MetaInfo] def consolidate(infos: List[MetaInfo]): List[List[MetaInfo]] </code></pre> <p>I want to construct a Pipeline like:</p> <pre><code>query("Terminator") -&gt; [askIMDB, askTMDB, ...] -&gt; filterRedundantSearchResults (already-searched-state per query) -&gt; [fetchIMDB, fetchTMDB, ...] -&gt; consolidate (collected-meta-infos-state per query) =&gt; List[ TerminatorI-List[MetaInfo], TerminatorII-List[MetaInfo], ...] </code></pre> <p>So far, I have implemented every Pipeline-Segment as an Actor. I need to create dedicated actor-instances for every Query, as some of those actors like filterXXX and consolidate need to maintain state per query.</p> <p>Functions like askIMDB produce multiple results which I want to process concurrently (each to a seperate actor). So I have not found any way to pre-construct the whole graph of actors <em>before</em> executing the query() and neither an elegant way to modify it at runtime.</p> <p>My first try was a chain of actors and passing sth like Transaction-IDs in the messages, so each Actor had a Map[TransactionID->State] but this felt rather ugly. The second try was to create a sort-of-Pipeline abstracting the digraph of actors into one flow but I failed so far.</p> <p>This is my first post, sorry if I forgot something or the question is to general/pseudo-coded. Any advice very much appreciated. Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload