| 188 | |
| 189 | |
| 190 | Future<Nothing> MockMasterAPISubscriber::subscribe( |
| 191 | const process::PID<Master>& masterPid, |
| 192 | ContentType contentType) |
| 193 | { |
| 194 | if (subscribeCalled) { |
| 195 | return Failure( |
| 196 | "MockMasterAPISubscriber::subscribe should be called at most once"); |
| 197 | } |
| 198 | |
| 199 | subscribeCalled = true; |
| 200 | |
| 201 | return dispatch( |
| 202 | pid, |
| 203 | &MockMasterAPISubscriberProcess::subscribe, |
| 204 | masterPid, |
| 205 | contentType); |
| 206 | } |
| 207 | |
| 208 | |
| 209 | void MockMasterAPISubscriber::handleEvent(const Event& event) |