Commit 709c160f authored by Millian Poquet's avatar Millian Poquet
Browse files

[code,doc] proto: REQUESTED_CALL event added

parent fb8ef6f7
......@@ -256,6 +256,19 @@ or
}
```
### REQUESTED_CALL
This message is a response to the [CALL_ME_LATER](#call_me_later) message.
- **data**: empty
- **example**:
```json
{
"timestamp": 25.5,
"type": "REQUESTED_CALL",
"data": {}
}
```
---
## Scheduler to Batsim events
......
......@@ -24,11 +24,24 @@ JsonProtocolWriter::~JsonProtocolWriter()
}
void JsonProtocolWriter::append_nop(double date)
void JsonProtocolWriter::append_requested_call(double date)
{
/* {
"timestamp": 25.5,
"type": "REQUESTED_CALL",
"data": {}
} */
xbt_assert(date >= _last_date, "Date inconsistency");
_last_date = date;
_is_empty = false;
_last_date = date;
_is_empty = false;
Value event(rapidjson::kObjectType);
event.AddMember("timestamp", Value().SetDouble(date), _alloc);
event.AddMember("type", Value().SetString("REQUESTED_CALL"), _alloc);
event.AddMember("data", Value().SetObject(), _alloc);
_events.PushBack(event, _alloc);
}
void JsonProtocolWriter::append_submit_job(const string &job_id,
......
......@@ -67,10 +67,10 @@ public:
// Bidirectional messages
/**
* @brief Appends a NOP message.
* @brief Appends a REQUESTED_CALL message.
* @param[in] date The event date. Must be greater than or equal to the previous event.
*/
virtual void append_nop(double date) = 0;
virtual void append_requested_call(double date) = 0;
// Messages from the Scheduler to Batsim
/**
......@@ -274,10 +274,10 @@ public:
// Bidirectional messages
/**
* @brief Appends a NOP message.
* @brief Appends a REQUESTED_CALL message.
* @param[in] date The event date. Must be greater than or equal to the previous event.
*/
void append_nop(double date);
void append_requested_call(double date);
// Messages from the Scheduler to Batsim
/**
......
......@@ -500,7 +500,7 @@ int server_process(int argc, char *argv[])
case IPMessageType::WAITING_DONE:
{
context->proto_writer->append_nop(MSG_get_clock());
context->proto_writer->append_requested_call(MSG_get_clock());
--nb_waiters;
} break; // end of case WAITING_DONE
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment