| 240 | |
| 241 | |
| 242 | Future<Option<Entry>> ZooKeeperStorageProcess::get(const string& name) |
| 243 | { |
| 244 | if (error.isSome()) { |
| 245 | return Failure(error.get()); |
| 246 | } else if (state != CONNECTED) { |
| 247 | Get* get = new Get(name); |
| 248 | pending.gets.push(get); |
| 249 | return get->promise.future(); |
| 250 | } |
| 251 | |
| 252 | Result<Option<Entry>> result = doGet(name); |
| 253 | |
| 254 | if (result.isNone()) { // Try again later. |
| 255 | Get* get = new Get(name); |
| 256 | pending.gets.push(get); |
| 257 | return get->promise.future(); |
| 258 | } else if (result.isError()) { |
| 259 | return Failure(result.error()); |
| 260 | } |
| 261 | |
| 262 | return result.get(); |
| 263 | } |
| 264 | |
| 265 | |
| 266 | Future<bool> ZooKeeperStorageProcess::set( |
no test coverage detected