engine

package
v0.0.0-...-1c8a91e Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConcurrentEngine

type ConcurrentEngine struct {
	Scheduler   Scheduler
	WorkerCount int
}

func (*ConcurrentEngine) Run

func (e *ConcurrentEngine) Run(seeds ...Request)

type ParseResult

type ParseResult struct {
	Requests []Request
	Items    []interface{}
}

func NilParser

func NilParser([]byte) ParseResult

处理nil parser情况

type ReadyNotifier

type ReadyNotifier interface {
	WorkerReady(chan Request)
}

type Request

type Request struct {
	Url        string
	ParserFunc func([]byte) ParseResult
}

type Scheduler

type Scheduler interface {
	Submit(Request)
	ConfigureMasterWorkerChan(chan Request)
	WorkerReady(chan Request)
	Run()
}

队列版本,缺乏通用性

type SimpleEngine

type SimpleEngine struct{}

func (SimpleEngine) Run

func (e SimpleEngine) Run(seeds ...Request)

Jump to

Keyboard shortcuts

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