Skip to content

Commit ced1939

Browse files
clean code
1 parent 0488f6a commit ced1939

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

src/main/scala/com/cosmin/examples/AkkaPipeline.scala

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/main/scala/com/cosmin/pipeline/executor/AkkaExecutor.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@ import com.cosmin.pipeline.executor.actor.Supervisor.Start
66

77
import scala.util.Try
88

9-
class AkkaExecutor[In, Out] extends PipelineExecutor[In, Out] {
9+
class AkkaExecutor[In, Out](system: ActorSystem) extends PipelineExecutor[In, Out] {
1010
override def execute(in: In, stages: List[Stage])(onComplete: Try[Out] => Unit): Unit = {
11-
val system = ActorSystem("pipeline")
1211
val supervisor = system.actorOf(Supervisor.props[Out](stages, onComplete), "pipeline-supervisor")
1312

1413
supervisor ! Start[In](in)
1514
}
1615
}
1716

1817
object AkkaExecutor {
19-
def apply[In, Out]: AkkaExecutor[In, Out] = new AkkaExecutor[In, Out]
18+
def apply[In, Out]: AkkaExecutor[In, Out] = new AkkaExecutor[In, Out](ActorSystem("pipeline"))
2019
}

0 commit comments

Comments
 (0)