1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-09-17 23:49:06 +00:00
arikawa/gateway/sequence.go

13 lines
275 B
Go

package gateway
import "sync/atomic"
type Sequence int64
func NewSequence() *Sequence {
return (*Sequence)(new(int64))
}
func (s *Sequence) Set(seq int64) { atomic.StoreInt64((*int64)(s), seq) }
func (s *Sequence) Get() int64 { return atomic.LoadInt64((*int64)(s)) }