class MyActor extends Actor with Receiver{
def receive {
case anything: String=> pushBlock(anything)
}
}
// Can be used with an actorStream as follows
ssc.actorStream[String](Props(new MyActor),"MyActorReceiver")
Note
Since Actor may exist outside the spark framework, It is thus user's responsibility
to ensure the type safety, i.e parametrized type of push block and InputDStream
should be same.
A receiver trait to be mixed in with your Actor to gain access to the API for pushing received data into Spark Streaming for being processed.
Find more details at: http://spark-project.org/docs/latest/streaming-custom-receivers.html
Since Actor may exist outside the spark framework, It is thus user's responsibility to ensure the type safety, i.e parametrized type of push block and InputDStream should be same.