Documentation
¶
Overview ¶
Package scheduler provides crawl task scheduling and resource allocation.
Index ¶
- func Init(threadNum int, proxyMinute int64)
- func PauseRecover()
- func ReloadProxyLib()
- func Stop()
- type Matrix
- func (m *Matrix) CanStop() bool
- func (m *Matrix) DoHistory(req *request.Request, ok bool) bool
- func (m *Matrix) Free()
- func (m *Matrix) Len() int
- func (m *Matrix) Pull() (req *request.Request)
- func (m *Matrix) Push(req *request.Request)
- func (m *Matrix) TryFlushFailure()
- func (m *Matrix) TryFlushSuccess()
- func (m *Matrix) Use()
- func (m *Matrix) Wait()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReloadProxyLib ¶
func ReloadProxyLib()
ReloadProxyLib reloads the proxy IP list from the config file.
Types ¶
type Matrix ¶
Matrix is the request queue for a single Spider instance.
func (*Matrix) DoHistory ¶
DoHistory records success/failure and returns true if the request was requeued as a new failure.
func (*Matrix) Pull ¶
Pull removes and returns a request from the queue, or nil if empty. Concurrency-safe.
func (*Matrix) TryFlushFailure ¶
func (m *Matrix) TryFlushFailure()
TryFlushFailure flushes failure history in non-server mode.
func (*Matrix) TryFlushSuccess ¶
func (m *Matrix) TryFlushSuccess()
TryFlushSuccess flushes success history in non-server mode.
Click to show internal directories.
Click to hide internal directories.