1234567891011121314151617181920212223242526 |
- package browser
- import (
- "context"
- )
- type (
- //执行单元
- Worker struct {
- baseCancel, incCancel context.CancelFunc
- ctx context.Context
- js string
- contentDelay int64
- }
- )
- // NewWorker
- func NewWorker(headless bool, showImage bool, proxyServe string, contentDelay int64, js string) *Worker {
- _, baseCancel, _, _, ctx, cancel := NewBrowser(headless, showImage, proxyServe)
- return &Worker{baseCancel: baseCancel,
- incCancel: cancel,
- ctx: ctx,
- js: js,
- contentDelay: contentDelay,
- }
- }
|