0

In Spray, for chunked response we can send chunked message with an ack like

peer ! MessageChunk(buffer).withAck(MyAck(k))

and we can get ack message back which confirms the message delivery to the OS network layer. Do we have something like timeouts for these acks ?

Tinku
  • 1,592
  • 1
  • 15
  • 27

1 Answers1

0

I don't think there is an Ack Timeout feature built in to spray.

It should be possible, for the Chunking Actor to keep track of sent messages & timeouts if your Ack contains details about the sent chunk. See ChunkingActor[T] used to marshall Stream[T] in the spray source code to get an idea of how this could be done. You may choose to have this actor keep track of the last chunk sent along with the time sent. If an Ack does not come back for that chunk during the set timeout, you can handle the case where chunk delivery has "timed out".

rahilb
  • 726
  • 3
  • 15