┌───────────────────────┐ │$q │ ├───────────────────────┤ │Defered defer() │ │Promise reject(razon) │ │Promise when(resultado)│ │Promises all(promises) │ └───────────────────────┘ | | ┌───────────────────────┐ │Defered │ ┌─────────────────────────────────────────────────────────┐ ├───────────────────────┤ │Promise │ │void resolve(resultado)│ ├─────────────────────────────────────────────────────────┤ │void reject(error) │---│Promise then(callBackSucess,callBackError,callBackNotify)│ │void notify(valor) │ │void finally(callBack) │ │Promise promise │ └─────────────────────────────────────────────────────────┘ └───────────────────────┘ | | | ┌──────────────────────────────────┐ ┌──────────────────────────┐ │Productor. │ │Consumidor. │ ├──────────────────────────────────┤ ├──────────────────────────┤ │notificar que ya está el resultado│ │pueda obtener el resultado│ │ │ │ │ └──────────────────────────────────┘ └──────────────────────────┘