This looks weird:
val file = scala.io.Source.fromFile(new File("./logfile.txt"))
val lines = file.getLines() <-- getLines here?
Source(() => file.getLines()).map(line => {
On Thu, Mar 19, 2015 at 8:28 PM, Martynas Mickevičius <
[email protected]> wrote:
> Hi,
>
> are you sure you do not stop this actor or the whole ActorSystem while the
> transfer is still going?
>
> On Thu, Mar 19, 2015 at 1:32 AM, zergood <[email protected]> wrote:
>
>> Hi!
>>
>> I want to stream file lines through tcp to server.
>>
>> Here is the code:
>>
>> class StreamingTcpActor(remoteAddress:InetSocketAddress, system:
>> ActorSystem){
>> implicit val actorSystem = system
>> implicit val materializer = ActorFlowMaterializer()
>>
>> val connection = StreamTcp().outgoingConnection(remoteAddress)
>> val file = scala.io.Source.fromFile(new File("./logfile.txt"))
>> val lines = file.getLines()
>>
>> Source(() => file.getLines()).map(line => {
>> val message = MessageWithId(UUID.randomUUID().toString, line)
>> RunTcpStreamEx.messageSerializer.toByteString(message)
>> }).via(connection.flow).to(Sink.ignore).run()
>> }
>>
>>
>> Problem: Some lines were not send to the network.
>> If I rewrite client code with out akka-streaming everything would be ok.
>>
>> I am new to akka streams. Could you provide me some doc links to figure
>> out what`s wrong here.
>>
>> --
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ:
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Martynas Mickevičius
> Typesafe <http://typesafe.com/> – Reactive
> <http://www.reactivemanifesto.org/> Apps on the JVM
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>
--
Cheers,
√
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.