*: add some comments to service Start/Shutdown methods

This commit is contained in:
Roman Khimov 2022-07-04 23:03:50 +03:00
parent 36d4c17a15
commit 3e2eda6752
8 changed files with 32 additions and 8 deletions

View file

@ -67,8 +67,11 @@ type Service interface {
Name() string
// Start initializes dBFT and starts event loop for consensus service.
// It must be called only when the sufficient amount of peers are connected.
// The service only starts once, subsequent calls to Start are no-op.
Start()
// Shutdown stops dBFT event loop.
// Shutdown stops dBFT event loop. It can only be called once, subsequent calls
// to Shutdown on the same instance are no-op. The instance that was stopped can
// not be started again by calling Start (use a new instance if needed).
Shutdown()
// OnPayload is a callback to notify the Service about a newly received payload.