This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package deiko | |
import scala.concurrent.Future | |
import scala.concurrent.duration.Duration | |
import scalaz.concurrent.Task | |
import scalaz.stream._ | |
import play.api.libs.iteratee._ | |
import Process._ | |
object Conversion { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.spinoco.util.streams | |
import java.util.concurrent.{LinkedBlockingQueue, ConcurrentLinkedQueue} | |
import scalaz.stream.Process | |
import scalaz.stream.processes._ | |
import java.util.concurrent.atomic.{AtomicInteger, AtomicReference} | |
import scalaz.concurrent.Task | |
import scalaz.\/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package scalaz.stream | |
import org.scalacheck.Prop._ | |
import org.scalacheck.Properties | |
import scala.concurrent.SyncVar | |
import scalaz.\/ | |
import scalaz.stream.Process._ | |
import scalaz.stream.async.mutable.Queue | |
import java.util.concurrent.{TimeUnit, Executors} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package scalaz.stream | |
import scalaz.stream.Process._ | |
import scalaz.stream.These.{This, That} | |
sealed trait ReceiveThese[+A,+B] | |
case class Receive[+A,+B](t:These[A,B]) extends ReceiveThese[A,B] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scalaz._ | |
import scalaz.stream.Process._ | |
import scalaz.stream.Process | |
import scalaz.stream.io | |
import scalaz.stream.process1 | |
import scala.util.matching.Regex | |
def matchRegex(pattern:Regex) : Process1[String,String] = | |
receive1[String,String]({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Topic that wrap state processor to produce | |
* - discrete stream of states that was created by publishing `A` | |
* - continuous stream of states that was created by publishing `A` | |
* - subscription to states and updates (S,A) | |
*/ | |
class StateTopic[S, A](stateProcessor: Process1[A, (S, A)], strategy: Strategy) { | |
val topic: Topic[(A or (S, A))] = async.topic[(A or (S, A))](strategy).journal( | |
collect[(A or (S, A)), A]({ case a: A => a }) |> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.spinoco | |
import scalaz.stream.{Exchange, process1, Process} | |
import scalaz.stream.Process._ | |
import scalaz.concurrent.Task | |
import scalaz.{-\/, \/-, \/} | |
/** | |
* Created by pach on 18/01/14. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package scalaz.stream | |
import scalaz._ | |
import scalaz.concurrent.Task | |
import scala.annotation.tailrec | |
/** | |
* Created by pach on 01/03/14. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Feed a sequence of inputs to a `Process1`. */ | |
def feed[I, O](i: Seq[I])(p: Process1[I, O]): Process1[I, O] = { | |
@tailrec | |
def go( | |
in: Seq[I], out: Vector[O] | |
, cur: Process1[I, O] | |
, stack: Vector[Throwable => Trampoline[Process1[I, O]]] | |
): Process1[I, O] = { | |
if (in.nonEmpty) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package scalaz.stream2 | |
import Process._ | |
import org.scalacheck.Prop._ | |
import org.scalacheck.Properties | |
import scalaz.concurrent.{Strategy, Task} | |
import scalaz.{\/, stream2, \/-, -\/} | |
import java.util.concurrent.atomic.AtomicInteger | |
import scala.concurrent.SyncVar | |
import scala.concurrent.duration._ |
OlderNewer