node

package
v0.0.0-...-c59394f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2017 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service for one user info

func New

func New(addr string, port int, masterAddr string) *Service

New allocates a new Service

func (*Service) ApplyMessageIDRange

func (s *Service) ApplyMessageIDRange(userID int64, queueName string, size int) (maxID int64, err error)

ApplyMessageIDRange tries to apply a range a free message id

func (*Service) Info

func (s *Service) Info() models.NodeInfo

Info returns the info of current service

func (*Service) PullMessages

func (s *Service) PullMessages(userID int64, queueName, squadName string, length int) ([]models.Message, error)

PullMessages pulls message from database, create it if the squad is not found

func (*Service) PushMessage

func (s *Service) PushMessage(userID int64, queueName, content string, index int64) error

PushMessage receives message

func (*Service) ReportMaxReceivedMessageID

func (s *Service) ReportMaxReceivedMessageID(userID int64, queueName, squadName string, messageID int64) error

ReportMaxReceivedMessageID reports the max received message id to mark forward of the squad process

func (*Service) Start

func (s *Service) Start()

Start starts services

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL