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

task: reimplement safe_late_task with future task #53

Merged
merged 3 commits into from
May 17, 2018

Conversation

shengofsun
Copy link
Contributor

No description provided.

//
virtual void clear_callback() {}
virtual void clear_non_trivial_on_task_end() {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

名字有点长,直接 clear_on_task_end() 呢?


typedef std::function<void(dsn::error_code)> err_callback;
typedef future_task<dsn::error_code> error_code_future;
typedef dsn::ref_ptr<error_code_future> error_code_future_ptr;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

上面有空行,下面没有

@@ -234,13 +236,14 @@ dsn::task_ptr fds_service::create_file(const create_file_request &req,
const create_file_callback &cb,
dsn::task_tracker *tracker = nullptr)
{
dsn::task_ptr t = dsn::tasking::create_late_task(code, cb, 0, tracker);
create_file_future_ptr t(new create_file_future(code, cb, 0));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

能不能设计成

auto t = tasking::create_future<create_file_future>(code, cb, tracker)

对比

create_file_future_ptr t(new create_file_future(code, cb, 0));
t->set_tracker(tracker);

qinzuoyan
qinzuoyan previously approved these changes May 17, 2018
Copy link
Member

@qinzuoyan qinzuoyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@neverchanje neverchanje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shengofsun shengofsun merged commit e9b1dde into XiaoMi:master May 17, 2018
@qinzuoyan qinzuoyan mentioned this pull request Aug 20, 2018
28 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants