2017-01-06 00:57:47 +01:00
|
|
|
---
|
|
|
|
layout: pattern
|
|
|
|
title: Guarded Suspension
|
|
|
|
folder: guarded-suspension
|
|
|
|
permalink: /patterns/guarded-suspension/
|
|
|
|
categories: Concurrency
|
|
|
|
tags:
|
|
|
|
- Java
|
|
|
|
- Difficulty-Beginner
|
|
|
|
---
|
|
|
|
|
|
|
|
## Intent
|
2017-02-28 15:06:50 +01:00
|
|
|
Use Guarded suspension pattern to handle a situation when you want to execute a method on object which is not in a proper state.
|
2017-01-06 01:01:47 +01:00
|
|
|
|
2017-01-06 00:57:47 +01:00
|
|
|

|
|
|
|
|
|
|
|
## Applicability
|
2017-02-28 15:06:50 +01:00
|
|
|
Use Guarded Suspension pattern when the developer knows that the method execution will be blocked for a finite period of time
|
2017-01-06 00:57:47 +01:00
|
|
|
|
2017-02-28 15:06:50 +01:00
|
|
|
## Related patterns
|
|
|
|
* Balking
|