Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distributed work refactor #2255

Merged

Conversation

guilhermelawless
Copy link
Contributor

By introducing:

  • A distributed work factory that also saves distributed work objects (as weak_ptr)
  • A work cancel observer

Work can now be properly cancelled across local generation and work peers, simply by using the observer.

work_generate now takes an optional so the caller may choose to handle work cancellation (work not set once callback was fired)

With a factory that also saves distributed work objects and a work cancel observer, work can now be properly cancelled to work peers
@guilhermelawless guilhermelawless added the quality improvements This item indicates the need for or supplies changes that improve maintainability label Aug 27, 2019
@guilhermelawless guilhermelawless added this to the V20.0 milestone Aug 27, 2019
@guilhermelawless guilhermelawless self-assigned this Aug 27, 2019
@guilhermelawless
Copy link
Contributor Author

guilhermelawless commented Aug 27, 2019

Most of the apparent changes are simply extracting distributed_work from node.cpp, the actual changes are distributed_work_factory and the new observer.

Tests added.

Copy link
Contributor

@cryptocode cryptocode left a comment

Choose a reason for hiding this comment

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

LGTM pending minor refactoring points

nano/node/distributed_work.cpp Outdated Show resolved Hide resolved
nano/node/distributed_work.cpp Outdated Show resolved Hide resolved
nano/core_test/distributed_work.cpp Show resolved Hide resolved
nano/core_test/distributed_work.cpp Outdated Show resolved Hide resolved
nano/node/distributed_work.cpp Outdated Show resolved Hide resolved
nano/node/CMakeLists.txt Show resolved Hide resolved
@guilhermelawless guilhermelawless removed the request for review from SergiySW August 29, 2019 16:33
@guilhermelawless guilhermelawless merged commit 060e3b2 into nanocurrency:master Aug 29, 2019
@guilhermelawless guilhermelawless deleted the distributed-work-refactor branch August 29, 2019 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
quality improvements This item indicates the need for or supplies changes that improve maintainability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants