Response

@safe
struct Response (
string name
ID = uint
) {
Msg!name msg;
ID id;
}

Examples

thisActor.task_name = "req_resp";
scope (exit) {
    unregister("req_resp");
    thisActor.task_name = "";
}
alias Some_req = Request!"some_req";
void some_responder(Some_req req) {
    req.respond("hello");
}

auto created_req = Some_req();
some_responder(created_req);
int received = receiveTimeout(Duration.zero, (Some_req.Response res, string _) {
    assert(created_req.msg == res.msg, "request msg were not the same");
    assert(created_req.id == res.id, "request id were not the same");
});
assert(received, "never received response");