Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

feat: update rpc_holder #456

Merged
merged 2 commits into from
May 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions include/dsn/cpp/rpc_holder.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ class rpc_holder
rpc_holder(std::unique_ptr<TRequest> req,
task_code code,
std::chrono::milliseconds timeout = 0_ms,
uint64_t partition_hash = 0)
: _i(new internal(req, code, timeout, partition_hash))
uint64_t partition_hash = 0,
int thread_hash = 0)
: _i(new internal(req, code, timeout, partition_hash, thread_hash))
{
}

Expand Down Expand Up @@ -251,14 +252,14 @@ class rpc_holder
internal(std::unique_ptr<TRequest> &req,
task_code code,
std::chrono::milliseconds timeout,
uint64_t partition_hash)
uint64_t partition_hash,
int thread_hash)
: thrift_request(std::move(req)), auto_reply(false)
{
dassert(thrift_request != nullptr, "req should not be null");

// leave thread_hash to 0
dsn_request = message_ex::create_request(
code, static_cast<int>(timeout.count()), 0, partition_hash);
code, static_cast<int>(timeout.count()), thread_hash, partition_hash);
dsn_request->add_ref();
marshall(dsn_request, *thrift_request);
}
Expand Down