forked from TrueCloudLab/frostfs-node
[#378] shard: Define new epoch event
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
182df23859
commit
89a22450e5
1 changed files with 16 additions and 0 deletions
|
@ -21,8 +21,24 @@ type eventType int
|
||||||
|
|
||||||
const (
|
const (
|
||||||
_ eventType = iota
|
_ eventType = iota
|
||||||
|
eventNewEpoch
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type newEpoch struct {
|
||||||
|
epoch uint64
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e newEpoch) typ() eventType {
|
||||||
|
return eventNewEpoch
|
||||||
|
}
|
||||||
|
|
||||||
|
// EventNewEpoch returns new epoch event.
|
||||||
|
func EventNewEpoch(e uint64) Event {
|
||||||
|
return newEpoch{
|
||||||
|
epoch: e,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
type eventHandler func(context.Context, Event)
|
type eventHandler func(context.Context, Event)
|
||||||
|
|
||||||
type eventHandlers struct {
|
type eventHandlers struct {
|
||||||
|
|
Loading…
Reference in a new issue