Skip to content

Commit

Permalink
Feat: cleanup passthrough scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
hmoog committed Mar 12, 2024
1 parent b1c8ec5 commit 70e0272
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
1 change: 0 additions & 1 deletion pkg/protocol/engine/clock/blocktime/clock.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ func NewProvider(opts ...options.Option[Clock]) module.Provider[*engine.Engine,
e.Events.Clock.ConfirmedTimeUpdated.LinkTo(c.confirmedTime.OnUpdated)

asyncOpt := event.WithWorkerPool(c.workerPool)

c.ShutdownEvent().OnTrigger(lo.Batch(
e.Events.BlockGadget.BlockAccepted.Hook(func(block *blocks.Block) {
c.acceptedTime.Advance(block.IssuingTime())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,11 @@ func NewProvider() module.Provider[*engine.Engine, scheduler.Scheduler] {
})
}

func New(module module.Module) *Scheduler {
s := &Scheduler{
Module: module,
func New(subModule module.Module) *Scheduler {
return module.InitSimpleLifecycle(&Scheduler{
Module: subModule,
events: scheduler.NewEvents(),
}

s.ConstructedEvent().Trigger()

s.ShutdownEvent().OnTrigger(func() {
s.StoppedEvent().Trigger()
})

s.InitializedEvent().Trigger()

return s
}

func (s *Scheduler) IsBlockIssuerReady(_ iotago.AccountID, _ ...iotago.WorkScore) bool {
Expand Down

0 comments on commit 70e0272

Please sign in to comment.