Derecho-Project / derecho

The main code repository for the Derecho project.
BSD 3-Clause "New" or "Revised" License
182 stars 46 forks source link

Deliver new-view callbacks to replicated objects #250

Closed etremel closed 1 year ago

etremel commented 1 year ago

I added a mechanism to deliver new-view callbacks to the user-provided objects that define each subgroup (i.e. the T in a Replicated) so that these objects can react to a view change if they want to. If a user-provided object inherits from GetsViewChangeCallback, and implements a method named new_view_callback, that method will be called by ViewManager during the last phase of a view change (along with the other "view upcalls"). The existing view_upcalls parameter to the Group constructor can't be used to provide this feature because the user-provided replicated objects are constructed within the Group constructor, and thus don't yet exist at the time you would need to declare a callback function for that parameter.