scheduler

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructRequest

func ConstructRequest(task *models.CrawlTask) (string, bool)

Types

type Scheduler

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

func NewScheduler

func NewScheduler(cookie *http.Cookie, storer *storage.BetterInMemoryStorage) *Scheduler

func (*Scheduler) Schedule

func (sch *Scheduler) Schedule(c *colly.Collector, taskq *TaskQueue) error

type TaskQueue

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

func NewTaskQueue

func NewTaskQueue(mq models.MessageQueue, channame string) *TaskQueue

func (*TaskQueue) Ack

func (taskq *TaskQueue) Ack(ackid uint64) error

func (*TaskQueue) GetTask

func (taskq *TaskQueue) GetTask() (*models.CrawlTask, uint64, uint8, error)

func (*TaskQueue) Publish

func (taskq *TaskQueue) Publish(name string, message models.MQMessage) error

func (*TaskQueue) Reject

func (taskq *TaskQueue) Reject(ackid uint64) error

func (*TaskQueue) Resend

func (taskq *TaskQueue) Resend(task *models.CrawlTask, priority uint8) error

Jump to

Keyboard shortcuts

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