github.com/diamondburned/arikawa@v1.3.14/gateway/sequence.go (about)

     1  package gateway
     2  
     3  import "sync/atomic"
     4  
     5  type Sequence int64
     6  
     7  func NewSequence() *Sequence {
     8  	return (*Sequence)(new(int64))
     9  }
    10  
    11  func (s *Sequence) Set(seq int64) { atomic.StoreInt64((*int64)(s), seq) }
    12  func (s *Sequence) Get() int64    { return atomic.LoadInt64((*int64)(s)) }