queue

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	QUEUE_SIZE = 4096
	WORKER_NUM = 2
)
View Source
var IsTest = false

Functions

func Close

func Close()

func InitConfig

func InitConfig() error

func ProcessCommentQueue

func ProcessCommentQueue(q *CommentQueue) (err error)

ProcessCommentQueue

We use LastTime as the reference time to obtain stable timestamp. (lastTime is from firstComments, assuming not change a lot.) (mtime changes frequently and may result in unstable timestamp.)

func ProcessCommentQueueStr added in v0.27.0

func ProcessCommentQueueStr(q *CommentQueueStr) (err error)

ProcessCommentQueue

We use LastTime as the reference time to obtain stable timestamp. (lastTime is from firstComments, assuming not change a lot.) (mtime changes frequently and may result in unstable timestamp.)

func QueueCommentDBCS

func QueueCommentDBCS(bboardID bbs.BBoardID, articleID bbs.ArticleID, ownerID bbs.UUserID, commentDBCS []byte, articleCreateTime types.NanoTS, articleMTime types.NanoTS, updateNanoTS types.NanoTS) (err error)

func QueueCommentDBCSStr added in v0.27.0

func QueueCommentDBCSStr(bboardID bbs.BBoardID, articleID bbs.ArticleID, ownerID bbs.UUserID, commentDBCS string, articleCreateTime types.NanoTS, articleMTime types.NanoTS, updateNanoTS types.NanoTS) (err error)

func SetIsTest

func SetIsTest()

func Start added in v0.20.0

func Start() error

func UnsetIsTest

func UnsetIsTest()

Types

type CommentQueue

type CommentQueue struct {
	BBoardID          bbs.BBoardID
	ArticleID         bbs.ArticleID
	OwnerID           bbs.UUserID
	CommentDBCS       []byte
	ArticleCreateTime types.NanoTS
	ArticleMTime      types.NanoTS
	UpdateNanoTS      types.NanoTS
}

type CommentQueueStr added in v0.27.0

type CommentQueueStr struct {
	BBoardID          bbs.BBoardID
	ArticleID         bbs.ArticleID
	OwnerID           bbs.UUserID
	CommentDBCS       string
	ArticleCreateTime types.NanoTS
	ArticleMTime      types.NanoTS
	UpdateNanoTS      types.NanoTS
}

Jump to

Keyboard shortcuts

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