nsqcrawl

package
v0.0.0-...-a1d1ef6 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2017 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

type Queue struct {
	*consumer.Consumer
	*producer.Producer
	// contains filtered or unexported fields
}

Queue - NSQ Queue.

func NewProducer

func NewProducer(topic string) *Queue

NewProducer - Creates queue producer.

func NewQueue

func NewQueue(topic, channel string, maxInFlight int) *Queue

NewQueue - Creates nsq consumer and producer.

func (*Queue) Close

func (queue *Queue) Close() (err error)

Close - Closes consumer and producer.

func (*Queue) Get

func (queue *Queue) Get() (crawl.Job, error)

Get - Gets job from channel.

func (*Queue) Schedule

func (queue *Queue) Schedule(ctx context.Context, req *crawl.Request) (err error)

Schedule - Schedules job in nsq. It will not call job.Done ever.

type Request

type Request struct {
	Request  *crawl.Request `json:"request,omitempty"`
	Deadline time.Time      `json:"deadline,omitempty"`
	Metadata metadata.MD    `json:"metadata,omitempty"`
}

Request - Request as it is in NSQ.

Jump to

Keyboard shortcuts

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