SetResult sets the completed result for an asynchronous function call.
(res ref.Val)
| 305 | |
| 306 | // SetResult sets the completed result for an asynchronous function call. |
| 307 | func (acs *asyncCallState) SetResult(res ref.Val) { |
| 308 | if acs == nil { |
| 309 | return |
| 310 | } |
| 311 | acs.mu.Lock() |
| 312 | defer acs.mu.Unlock() |
| 313 | acs.result = res |
| 314 | } |
| 315 | |
| 316 | // launch returns a call's cached result, or starts the call (subject to the launch limiter) and |
| 317 | // returns an Unknown referencing its callID while the result is pending. |