2015-08-13 23:54:40 +02:00
|
|
|
---
|
|
|
|
layout: pattern
|
|
|
|
title: Poison Pill
|
|
|
|
folder: poison-pill
|
2015-08-15 18:03:05 +02:00
|
|
|
permalink: /patterns/poison-pill/
|
2015-08-20 21:40:07 +02:00
|
|
|
categories: Other
|
|
|
|
tags: Java
|
2015-08-13 23:54:40 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
**Intent:** Poison Pill is known predefined data item that allows to provide
|
|
|
|
graceful shutdown for separate distributed consumption process.
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
**Applicability:** Use the Poison Pill idiom when
|
|
|
|
|
|
|
|
* need to send signal from one thread/process to another to terminate
|
|
|
|
|
|
|
|
**Real world examples:**
|
|
|
|
|
2015-08-15 18:03:05 +02:00
|
|
|
* [akka.actor.PoisonPill](http://doc.akka.io/docs/akka/2.1.4/java/untyped-actors.html)
|