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

Feature/subscription engine #813

Merged

Conversation

iceseer
Copy link
Contributor

@iceseer iceseer commented Feb 15, 2021

Linked issue

Closes #831

Description of the Change

Subscription engine implementation.

Benefits

Possible Drawbacks

Usage Examples or Tests [optional]

Alternate Designs [optional]

Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>

# Conflicts:
#	irohad/main/application.cpp
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
irohad/subscription/common.hpp Show resolved Hide resolved
irohad/subscription/common.hpp Outdated Show resolved Hide resolved
irohad/subscription/common.hpp Outdated Show resolved Hide resolved
irohad/subscription/common.hpp Outdated Show resolved Hide resolved
irohad/subscription/common.hpp Outdated Show resolved Hide resolved
irohad/subscription/common.hpp Outdated Show resolved Hide resolved
Signed-off-by: iceseer <[email protected]>
irohad/subscription/thread_handler.hpp Outdated Show resolved Hide resolved
irohad/subscription/common.hpp Outdated Show resolved Hide resolved
irohad/subscription/dispatcher.hpp Outdated Show resolved Hide resolved
irohad/subscription/thread_handler.hpp Outdated Show resolved Hide resolved
irohad/subscription/thread_handler.hpp Outdated Show resolved Hide resolved
irohad/subscription/thread_handler.hpp Outdated Show resolved Hide resolved
irohad/subscription/thread_handler.hpp Outdated Show resolved Hide resolved
irohad/subscription/thread_handler.hpp Show resolved Hide resolved
irohad/subscription/thread_handler.hpp Outdated Show resolved Hide resolved
irohad/subscription/thread_handler.hpp Outdated Show resolved Hide resolved
libs/common/compile-time_murmur2.hpp Show resolved Hide resolved
Signed-off-by: iceseer <[email protected]>
Signed-off-by: iceseer <[email protected]>
@iceseer iceseer requested a review from kuvaldini March 10, 2021 13:15
Comment on lines +32 to +36
template <typename F>
void add(Tid tid, F &&f) {
assert(tid < kHandlersCount);
handlers_[tid].add(std::forward<F>(f));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's reuse neibor function

Suggested change
template <typename F>
void add(Tid tid, F &&f) {
assert(tid < kHandlersCount);
handlers_[tid].add(std::forward<F>(f));
}
template <typename F>
void add(Tid tid, F &&f) {
addDelayed(tid,{0},std::forward<F>(f));
}

}

template <typename F>
void addDelayed(Tid tid, std::chrono::microseconds timeout, F &&f) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Если читать код как прозу - тогда "диспетчер добавь отложенное" звучит не обчень понятно. что добавить и куда?

Если обратится в boost::asio они говорят io_context::run_after() и тут понятно что это отложенный запуск задачи-функции.

Это вопрос конечно на функциональность не влияющий – но если мы будем писать понятный код потомки нас будут благодарить. и сами себя

@iceseer iceseer merged commit 6a558b5 into hyperledger-iroha:support/1.2.x Mar 10, 2021
@iceseer iceseer deleted the test/subscription_engine branch March 10, 2021 13:58
This was referenced Jul 12, 2021
kuvaldini pushed a commit that referenced this pull request Jul 30, 2021
* subscription: utils

Signed-off-by: iceseer <[email protected]>

* threaded handler

Signed-off-by: iceseer <[email protected]>

* threaded handler queue

Signed-off-by: iceseer <[email protected]>

* threaded handler queue

Signed-off-by: iceseer <[email protected]>

* threaded handler queue

Signed-off-by: iceseer <[email protected]>

* refactoring

Signed-off-by: iceseer <[email protected]>

* dispatcher

Signed-off-by: iceseer <[email protected]>

* dispatcher

Signed-off-by: iceseer <[email protected]>

* subscription engine

Signed-off-by: iceseer <[email protected]>

* format

Signed-off-by: iceseer <[email protected]>

* compile-time murmur2

Signed-off-by: iceseer <[email protected]>

* engine refactoring

Signed-off-by: iceseer <[email protected]>

* dispatcher in engine

Signed-off-by: iceseer <[email protected]>

* TID chained

Signed-off-by: iceseer <[email protected]>

* dispatcher checks

Signed-off-by: iceseer <[email protected]>

* engine multithreaded

Signed-off-by: iceseer <[email protected]>

* format

Signed-off-by: iceseer <[email protected]>

* format

Signed-off-by: iceseer <[email protected]>

* manager

Signed-off-by: iceseer <[email protected]>

* compiled

Signed-off-by: iceseer <[email protected]>

* compiled

Signed-off-by: iceseer <[email protected]>

* work

Signed-off-by: iceseer <[email protected]>

* refactoring

Signed-off-by: iceseer <[email protected]>

* format

Signed-off-by: iceseer <[email protected]>

* comments

Signed-off-by: iceseer <[email protected]>

* test

Signed-off-by: iceseer <[email protected]>

* rollback test

Signed-off-by: iceseer <[email protected]>

# Conflicts:
#	irohad/main/application.cpp

* move args

Signed-off-by: iceseer <[email protected]>

* thread safe

Signed-off-by: iceseer <[email protected]>

* fixup!

Signed-off-by: iceseer <[email protected]>

* refactoring

Signed-off-by: iceseer <[email protected]>

* format

Signed-off-by: iceseer <[email protected]>

* rw object holder

Signed-off-by: iceseer <[email protected]>

* rename

Signed-off-by: iceseer <[email protected]>

* SE sync call

Signed-off-by: iceseer <[email protected]>

* issue fixes

Signed-off-by: iceseer <[email protected]>

* revert sync call

Signed-off-by: iceseer <[email protected]>
Signed-off-by: Alexander Lednev <[email protected]>
kuvaldini pushed a commit that referenced this pull request Jul 30, 2021
* subscription: utils

Signed-off-by: iceseer <[email protected]>

* threaded handler

Signed-off-by: iceseer <[email protected]>

* threaded handler queue

Signed-off-by: iceseer <[email protected]>

* threaded handler queue

Signed-off-by: iceseer <[email protected]>

* threaded handler queue

Signed-off-by: iceseer <[email protected]>

* refactoring

Signed-off-by: iceseer <[email protected]>

* dispatcher

Signed-off-by: iceseer <[email protected]>

* dispatcher

Signed-off-by: iceseer <[email protected]>

* subscription engine

Signed-off-by: iceseer <[email protected]>

* format

Signed-off-by: iceseer <[email protected]>

* compile-time murmur2

Signed-off-by: iceseer <[email protected]>

* engine refactoring

Signed-off-by: iceseer <[email protected]>

* dispatcher in engine

Signed-off-by: iceseer <[email protected]>

* TID chained

Signed-off-by: iceseer <[email protected]>

* dispatcher checks

Signed-off-by: iceseer <[email protected]>

* engine multithreaded

Signed-off-by: iceseer <[email protected]>

* format

Signed-off-by: iceseer <[email protected]>

* format

Signed-off-by: iceseer <[email protected]>

* manager

Signed-off-by: iceseer <[email protected]>

* compiled

Signed-off-by: iceseer <[email protected]>

* compiled

Signed-off-by: iceseer <[email protected]>

* work

Signed-off-by: iceseer <[email protected]>

* refactoring

Signed-off-by: iceseer <[email protected]>

* format

Signed-off-by: iceseer <[email protected]>

* comments

Signed-off-by: iceseer <[email protected]>

* test

Signed-off-by: iceseer <[email protected]>

* rollback test

Signed-off-by: iceseer <[email protected]>

# Conflicts:
#	irohad/main/application.cpp

* move args

Signed-off-by: iceseer <[email protected]>

* thread safe

Signed-off-by: iceseer <[email protected]>

* fixup!

Signed-off-by: iceseer <[email protected]>

* refactoring

Signed-off-by: iceseer <[email protected]>

* format

Signed-off-by: iceseer <[email protected]>

* rw object holder

Signed-off-by: iceseer <[email protected]>

* rename

Signed-off-by: iceseer <[email protected]>

* SE sync call

Signed-off-by: iceseer <[email protected]>

* issue fixes

Signed-off-by: iceseer <[email protected]>

* revert sync call

Signed-off-by: iceseer <[email protected]>
Signed-off-by: Alexander Lednev <[email protected]>
kuvaldini pushed a commit that referenced this pull request Aug 31, 2021
* subscription: utils

Signed-off-by: iceseer <[email protected]>

* threaded handler

Signed-off-by: iceseer <[email protected]>

* threaded handler queue

Signed-off-by: iceseer <[email protected]>

* threaded handler queue

Signed-off-by: iceseer <[email protected]>

* threaded handler queue

Signed-off-by: iceseer <[email protected]>

* refactoring

Signed-off-by: iceseer <[email protected]>

* dispatcher

Signed-off-by: iceseer <[email protected]>

* dispatcher

Signed-off-by: iceseer <[email protected]>

* subscription engine

Signed-off-by: iceseer <[email protected]>

* format

Signed-off-by: iceseer <[email protected]>

* compile-time murmur2

Signed-off-by: iceseer <[email protected]>

* engine refactoring

Signed-off-by: iceseer <[email protected]>

* dispatcher in engine

Signed-off-by: iceseer <[email protected]>

* TID chained

Signed-off-by: iceseer <[email protected]>

* dispatcher checks

Signed-off-by: iceseer <[email protected]>

* engine multithreaded

Signed-off-by: iceseer <[email protected]>

* format

Signed-off-by: iceseer <[email protected]>

* format

Signed-off-by: iceseer <[email protected]>

* manager

Signed-off-by: iceseer <[email protected]>

* compiled

Signed-off-by: iceseer <[email protected]>

* compiled

Signed-off-by: iceseer <[email protected]>

* work

Signed-off-by: iceseer <[email protected]>

* refactoring

Signed-off-by: iceseer <[email protected]>

* format

Signed-off-by: iceseer <[email protected]>

* comments

Signed-off-by: iceseer <[email protected]>

* test

Signed-off-by: iceseer <[email protected]>

* rollback test

Signed-off-by: iceseer <[email protected]>

# Conflicts:
#	irohad/main/application.cpp

* move args

Signed-off-by: iceseer <[email protected]>

* thread safe

Signed-off-by: iceseer <[email protected]>

* fixup!

Signed-off-by: iceseer <[email protected]>

* refactoring

Signed-off-by: iceseer <[email protected]>

* format

Signed-off-by: iceseer <[email protected]>

* rw object holder

Signed-off-by: iceseer <[email protected]>

* rename

Signed-off-by: iceseer <[email protected]>

* SE sync call

Signed-off-by: iceseer <[email protected]>

* issue fixes

Signed-off-by: iceseer <[email protected]>

* revert sync call

Signed-off-by: iceseer <[email protected]>
Signed-off-by: Alexander Lednev <[email protected]>
@kamilsa kamilsa mentioned this pull request Sep 2, 2021
baziorek pushed a commit to petermetz/iroha that referenced this pull request Dec 30, 2021
* subscription: utils

Signed-off-by: iceseer <[email protected]>

* threaded handler

Signed-off-by: iceseer <[email protected]>

* threaded handler queue

Signed-off-by: iceseer <[email protected]>

* threaded handler queue

Signed-off-by: iceseer <[email protected]>

* threaded handler queue

Signed-off-by: iceseer <[email protected]>

* refactoring

Signed-off-by: iceseer <[email protected]>

* dispatcher

Signed-off-by: iceseer <[email protected]>

* dispatcher

Signed-off-by: iceseer <[email protected]>

* subscription engine

Signed-off-by: iceseer <[email protected]>

* format

Signed-off-by: iceseer <[email protected]>

* compile-time murmur2

Signed-off-by: iceseer <[email protected]>

* engine refactoring

Signed-off-by: iceseer <[email protected]>

* dispatcher in engine

Signed-off-by: iceseer <[email protected]>

* TID chained

Signed-off-by: iceseer <[email protected]>

* dispatcher checks

Signed-off-by: iceseer <[email protected]>

* engine multithreaded

Signed-off-by: iceseer <[email protected]>

* format

Signed-off-by: iceseer <[email protected]>

* format

Signed-off-by: iceseer <[email protected]>

* manager

Signed-off-by: iceseer <[email protected]>

* compiled

Signed-off-by: iceseer <[email protected]>

* compiled

Signed-off-by: iceseer <[email protected]>

* work

Signed-off-by: iceseer <[email protected]>

* refactoring

Signed-off-by: iceseer <[email protected]>

* format

Signed-off-by: iceseer <[email protected]>

* comments

Signed-off-by: iceseer <[email protected]>

* test

Signed-off-by: iceseer <[email protected]>

* rollback test

Signed-off-by: iceseer <[email protected]>

# Conflicts:
#	irohad/main/application.cpp

* move args

Signed-off-by: iceseer <[email protected]>

* thread safe

Signed-off-by: iceseer <[email protected]>

* fixup!

Signed-off-by: iceseer <[email protected]>

* refactoring

Signed-off-by: iceseer <[email protected]>

* format

Signed-off-by: iceseer <[email protected]>

* rw object holder

Signed-off-by: iceseer <[email protected]>

* rename

Signed-off-by: iceseer <[email protected]>

* SE sync call

Signed-off-by: iceseer <[email protected]>

* issue fixes

Signed-off-by: iceseer <[email protected]>

* revert sync call

Signed-off-by: iceseer <[email protected]>
Signed-off-by: Alexander Lednev <[email protected]>
Signed-off-by: G.Bazior <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants