When you create a materializer with `ActorFlowMaterializer()` inside an
actor the flow will run as a child actor and therefore be bound to the
lifecycle of the enclosing actor. There is an `implicit context:
ActorRefFactory` parameter.

However, I see that you are actually scoping it to the system with
implicit val system = context.system

so there is something else that is wrong.

/Patrik



On Wed, Jun 17, 2015 at 1:21 AM, Jason Martens <[email protected]> wrote:

> I think my problem now is that I'm trying to use akka-http within the
> ActorPublisher. Is there a correct way to create the materializer inside of
> an actor? The behavior I have now is that the entire stream completes after
> I complete the first HttpResponse inside my ActorPublisher like so:
>       val source = response.get.entity.dataBytes
>       val fut = source.grouped(10000000).runWith(Sink.head)
>       fut.onComplete(...)
> I'm using grouped to collect a potentially chunked response here.
>
> I've created a repo at
> https://github.com/jasonmartens/AkkaStreamsChunkedDownloader
> Would love to hear any feedback or suggestions that you are willing to
> give.
>
> Thanks,
> Jason
>
>
> On Monday, June 15, 2015 at 1:51:49 PM UTC-7, Jason Martens wrote:
>>
>> After some more debugging, it appears that I'm getting a Cancel message
>> before the entire file contents is downloaded. However, I'm not sure why
>> that is. What would cause the stream to be cancelled in this example?
>>
>> Thanks,
>> Jason
>>
>> On Monday, June 15, 2015 at 9:11:38 AM UTC-7, Jason Martens wrote:
>>>
>>> Hello,
>>>    I'm continuing my attempts to write a robust chunked large file
>>> downloader. I experience frequent timeouts when reading chunks (*cough* S3
>>> *cough*), so my original attempts just using stream elements were failing
>>> due to a single chunk timing out. I now have an ActorPublisher that tracks
>>> all the chunks to be downloaded (assumes the file size is known ahead of
>>> time) and makes sure that each chunk is actually completed. However, after
>>> downloading some number of chunks, the system stalls and I get a lot of
>>> undeliverable message errors. I'm not sure why this is happening, and the
>>> number of chunks completed before the system fails seems random so I'm
>>> guessing I have a race condition somewhere.
>>>
>>> Here is what I currently have:
>>> https://gist.github.com/ed6fd6f8aeabc5846aa2.git
>>>
>>> If anyone could give me some ideas what to look at, that would be very
>>> helpful.
>>>
>>> Thanks!
>>> Jason
>>>
>>  --
> >>>>>>>>>> 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.
>



-- 

Patrik Nordwall
Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
Twitter: @patriknw

-- 
>>>>>>>>>>      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.

Reply via email to