github.com/MetalBlockchain/metalgo@v1.11.9/snow/engine/avalanche/bootstrap/queue/job.go (about)

     1  // Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
     2  // See the file LICENSE for licensing terms.
     3  
     4  package queue
     5  
     6  import (
     7  	"context"
     8  
     9  	"github.com/MetalBlockchain/metalgo/ids"
    10  	"github.com/MetalBlockchain/metalgo/utils/set"
    11  )
    12  
    13  // Job defines the interface required to be placed on the job queue.
    14  type Job interface {
    15  	ID() ids.ID
    16  	MissingDependencies(context.Context) (set.Set[ids.ID], error)
    17  	// Returns true if this job has at least 1 missing dependency
    18  	HasMissingDependencies(context.Context) (bool, error)
    19  	Execute(context.Context) error
    20  	Bytes() []byte
    21  }