-
Notifications
You must be signed in to change notification settings - Fork 278
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
Feature/subscription engine #813
Conversation
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
c773d5f
to
aff5567
Compare
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]>
994a4d9
to
fb48bf4
Compare
template <typename F> | ||
void add(Tid tid, F &&f) { | ||
assert(tid < kHandlersCount); | ||
handlers_[tid].add(std::forward<F>(f)); | ||
} |
There was a problem hiding this comment.
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
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) { |
There was a problem hiding this comment.
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()
и тут понятно что это отложенный запуск задачи-функции.
Это вопрос конечно на функциональность не влияющий – но если мы будем писать понятный код потомки нас будут благодарить. и сами себя
* 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]>
* 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]>
* 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]>
* 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]>
Linked issue
Closes #831
Description of the Change
Subscription engine implementation.
Benefits
Possible Drawbacks
Usage Examples or Tests [optional]
Alternate Designs [optional]