+str #15588,#17229 Java 6 Synchronous File Sink / Source
These are synchronous implementations, because we need to be Java 6 compatible while developing on 2.3.x. However asynchronous implementations using AsynchronousFileChannel will come soon for JDK7 users. + ActorPublisher/Subscriber now manage stopping of the actor + added documentation on configuring dispatcher for File IO + properly handle if source file does not exist + file sink / source come with default io dispatcher > verified no actors are leaking > exceptions are caught and onErrored properly + moved files to akka.stream.io + Added OutputStreamSink and InputStreamSource
This commit is contained in:
parent
a1639c4312
commit
cebd9bf1ae
37 changed files with 1581 additions and 86 deletions
|
|
@ -27,7 +27,8 @@ import scala.concurrent.{ Await, ExecutionContextExecutor }
|
|||
/**
|
||||
* INTERNAL API
|
||||
*/
|
||||
private[akka] case class ActorFlowMaterializerImpl(override val settings: ActorFlowMaterializerSettings,
|
||||
private[akka] case class ActorFlowMaterializerImpl(override val system: ActorSystem,
|
||||
override val settings: ActorFlowMaterializerSettings,
|
||||
dispatchers: Dispatchers,
|
||||
supervisor: ActorRef,
|
||||
flowNameCounter: AtomicLong,
|
||||
|
|
@ -244,6 +245,13 @@ private[akka] object StreamSupervisor {
|
|||
def props(settings: ActorFlowMaterializerSettings): Props = Props(new StreamSupervisor(settings))
|
||||
|
||||
final case class Materialize(props: Props, name: String) extends DeadLetterSuppression
|
||||
|
||||
/** Testing purpose */
|
||||
final case object GetChildren
|
||||
/** Testing purpose */
|
||||
final case class Children(children: Set[ActorRef])
|
||||
/** Testing purpose */
|
||||
final case object StopChildren
|
||||
}
|
||||
|
||||
private[akka] class StreamSupervisor(settings: ActorFlowMaterializerSettings) extends Actor {
|
||||
|
|
@ -255,6 +263,8 @@ private[akka] class StreamSupervisor(settings: ActorFlowMaterializerSettings) ex
|
|||
case Materialize(props, name) ⇒
|
||||
val impl = context.actorOf(props, name)
|
||||
sender() ! impl
|
||||
case GetChildren ⇒ sender() ! Children(context.children.toSet)
|
||||
case StopChildren ⇒ context.children.foreach(context.stop)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue