-
Notifications
You must be signed in to change notification settings - Fork 21
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
Removal of SyncConsumer, added synchronization between consumers in BaseFilter class #149
Removal of SyncConsumer, added synchronization between consumers in BaseFilter class #149
Conversation
Try<Nothing> _consume(const T& in) { | ||
newProductForConsumption(); | ||
// let derived class consume the product | ||
Try<Nothing> result = consume(in); |
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.
Can we store the products in the consumer itself (append to list of products)?
LGTM! Great job. (: Please add some diagram of inheritance in our doc |
* Every component should produce all it's products in the iteration. | ||
* Components must not throw exceptions. | ||
|
||
## Pipeline |
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.
What do you plan to have here?
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.
Here we should put some considerations for Serenity developers.
Contentions()); | ||
return Nothing(); | ||
produceResults(corrections.get(), Contentions()); | ||
return; |
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.
Not needed return.
…136_remove_syncConsumer
// this->reset(); | ||
// If allProductsReady didn't produced all products - log error. | ||
if (notAllProductsProduced()) { | ||
// TODO(skonefal): Make '<<' virutal, so we could log component name. |
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.
s/virutal/virtual/
Good job, small nits and we are good to go! |
Signed-off-by: bplotka <bwplotka@gmail.com>
Signed-off-by: bplotka <bwplotka@gmail.com>
Removed reason of build error in gcc 4.8.4
Removal of SyncConsumer, added synchronization between consumers in BaseFilter class
Ready for review.
Added virtually inherited class above Consumers and Producers to add synchronization barrier.
Serenity framework is now hardened.
In each "addConsumer" function, the consumer is informed that it will receive objects from producer.
In each "consume" event, FilterBase counts number of products that has came from producers, and when this number is equals to number of expected products - allProductsReady() function is invoked. In the end, cleanup() function is invoked.
In each producer constructor we now count number of products that should be produced in each iteration. Pipeline must go forward.
Removal of SyncConsumer class. It's functionality is not inside Consumer.