java - Stop actor message processing on timeout -


i using ask pattern timeout send message actor, might take long time process it. stop processing message if timeout expires. but, seems actor keeps processing message, , receive dead letter.

how can stop actor processing message when timeout expires?

the short answer can't. once starts processing it, sending kill or poison pill or stopping prevent processing future messages. long answer maybe can hack around if actor happened in loop of sort , checking mutable (and potentially globally available) signal stopping looping, there many red flags approach should forget mentioned it. , if long call happened blocking io call db, forget it; you're stuck until call completes (or times out if lucky).

the actor not aware called via ask , there future upstream might time out. has no concept of , can not react accordingly when future times out.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -