Scala Gremlins Pub Share

Razie's Gremlins stands for coordinating asynchronous workflows in a scala DSL (both internal and external).

The code and forum are available.

Here are some examples of completely asynchronous flows described in scala DSL

v(c) (c ? P | c ! Q)

The engine running these has a configurable strategy and can use either Threads directly or scala actors.

val workflow = seq {    
  par {      
    seq {      
      println ("he he - definition time")
      later { _ + "runtime-a" }
      }
    later { _ + "runtime-b" }
    }
    sort[String] (_ < _)
    matchLater { case x : List[String] => x mkString "," }  
  }

There's more...

//this is scala code (internal DSL with content assist and all that)
def wif1 = 
wif (_ == 1) {  // no good, really - condition not serializable
   wf.inc + wf.log ($0)
 } welse { 
   wf.inc + wf.inc + wf.log ($0)
 }

Enjoy! There's a lot more on github.


Was this useful?    

By: Razie | 2014-11-03 .. 2017-05-08 | Tags: post , scala , dsl , workflow , reactive , akka


See more in: Cool Scala Subscribe

Viewed 4934 times ( | History | Print ) this page.

You need to log in to post a comment!