Documentation ¶
Index ¶
- Constants
- type Distributer
- func (this *Distributer) Distribute(request *http.Request)
- func (this *Distributer) IsPause() bool
- func (this *Distributer) IsStop() bool
- func (this *Distributer) Pause()
- func (this *Distributer) Run()
- func (this *Distributer) Start()
- func (this *Distributer) Stop()
- func (this *Distributer) Unpause()
- type Reporter
Constants ¶
View Source
const ( DISTRIBUTE_RUNING = iota DISTRIBUTE_PAUSE DISTRIBUTE_STOP DISTRIBUTE_STOPED )
what a Distributer do * status,running|parse|stop * distribute a request,by some strategy * *
View Source
const ( REPORT_STATUS_RUNNING = iota REPORT_STATUS_PAUSE REPORT_STATUS_STOP REPORT_STATUS_STOPED )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Distributer ¶
type Distributer struct { Status int Cluster cluster.Cluster Node node.Node LastIndex int RpcClient action.RpcClientAnts }
func NewDistributer ¶
func NewDistributer(node node.Node, cluster cluster.Cluster, rpcClient action.RpcClientAnts) *Distributer
func (*Distributer) Distribute ¶
func (this *Distributer) Distribute(request *http.Request)
if cookiejar > 0 means it require cookie context ,so we should send it to where it come from else distribute it by order
func (*Distributer) IsPause ¶
func (this *Distributer) IsPause() bool
func (*Distributer) IsStop ¶
func (this *Distributer) IsStop() bool
func (*Distributer) Pause ¶
func (this *Distributer) Pause()
func (*Distributer) Start ¶
func (this *Distributer) Start()
func (*Distributer) Stop ¶
func (this *Distributer) Stop()
func (*Distributer) Unpause ¶
func (this *Distributer) Unpause()
type Reporter ¶
type Reporter struct { Status int ResultQuene *crawler.ResultQuene Node node.Node // contains filtered or unexported fields }
func NewReporter ¶
func (*Reporter) JudgeAndStopNode ¶
func (this *Reporter) JudgeAndStopNode(result *crawler.ScrapeResult)
stop action is start by local report action so put it here
func (*Reporter) Run ¶
func (this *Reporter) Run()
pop result quene if scraped new request set node name local node name send it to master
Click to show internal directories.
Click to hide internal directories.