github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/engine/fifoqueue.go (about)

     1  package engine
     2  
     3  import (
     4  	"github.com/onflow/flow-go/engine/common/fifoqueue"
     5  )
     6  
     7  // FifoMessageStore wraps a FiFo Queue to implement the MessageStore interface.
     8  type FifoMessageStore struct {
     9  	*fifoqueue.FifoQueue
    10  }
    11  
    12  func (s *FifoMessageStore) Put(msg *Message) bool {
    13  	return s.Push(msg)
    14  }
    15  
    16  func (s *FifoMessageStore) Get() (*Message, bool) {
    17  	msgint, ok := s.Pop()
    18  	if !ok {
    19  		return nil, false
    20  	}
    21  	return msgint.(*Message), true
    22  }