Get returns the value the the task with the provided key and a boolean that indicates if the value was found or not. If the value is not found, the returned task is a zero value and the bool is false.
(key string)
| 52 | // indicates if the value was found or not. If the value is not found, the |
| 53 | // returned task is a zero value and the bool is false. |
| 54 | func (tasks *Tasks) Get(key string) (*Task, bool) { |
| 55 | if tasks == nil || tasks.om == nil { |
| 56 | return &Task{}, false |
| 57 | } |
| 58 | defer tasks.mutex.RUnlock() |
| 59 | tasks.mutex.RLock() |
| 60 | return tasks.om.Get(key) |
| 61 | } |
| 62 | |
| 63 | // Set sets the value of the task with the provided key to the provided value. |
| 64 | // If the task already exists, its value is updated. If the task does not exist, |