Promise 承诺模式 Posted on 2020-12-08 In Design Pattern , Concurrent Pattern 说明通过返回包含阻塞方法的凭据对象,使得调用方法无需等待即可继续执行,待需要结果时,通过调用凭据对象的阻塞方法获取结果。 类图ClientPromisorPromise compute()TaskExecutorrun()ResultPromiseResult getResult()setResult( Result )isDone() Sequence DiagramClientClientPromisorPromisorPromisePromise1 : computer()2 : <<create>>4 : getResult() Welcome to my other publishing channels RSS