| 204 | } |
| 205 | |
| 206 | void send(ExecutorDriver* driver, const Call& call) |
| 207 | { |
| 208 | CHECK_NOTNULL(driver); |
| 209 | |
| 210 | switch (call.type()) { |
| 211 | case Call::SUBSCRIBE: { |
| 212 | subscribeCall = true; |
| 213 | |
| 214 | // The driver subscribes implicitly with the agent upon initialization. |
| 215 | // For compatibility with the v1 interface, send the already enqueued |
| 216 | // subscribed event upon receiving the subscribe request. |
| 217 | _received(); |
| 218 | |
| 219 | break; |
| 220 | } |
| 221 | |
| 222 | case Call::UPDATE: { |
| 223 | driver->sendStatusUpdate(devolve(call.update().status())); |
| 224 | break; |
| 225 | } |
| 226 | |
| 227 | case Call::MESSAGE: { |
| 228 | driver->sendFrameworkMessage(call.message().data()); |
| 229 | break; |
| 230 | } |
| 231 | |
| 232 | case Call::HEARTBEAT: { |
| 233 | // NOTE: Heartbeat calls were added to HTTP executors only. |
| 234 | // There is no equivalent method for PID-based executors. |
| 235 | break; |
| 236 | } |
| 237 | |
| 238 | case Call::UNKNOWN: { |
| 239 | EXIT(EXIT_FAILURE) << "Received an unexpected " << call.type() |
| 240 | << " call"; |
| 241 | break; |
| 242 | } |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | protected: |
| 247 | void received(const Event& event) |
nothing calls this directly
no test coverage detected