Class AbstractCrawler
-
- All Implemented Interfaces:
-
ai.platon.pulsar.common.event.EventEmitter,ai.platon.pulsar.skeleton.crawl.Crawler,java.lang.AutoCloseable
public abstract class AbstractCrawler extends AbstractEventEmitter<CrawlEvents> implements Crawler
-
-
Field Summary
Fields Modifier and Type Field Description private final Integeridprivate final Stringnameprivate Function2<Integer, UrlAware, Duration>retryDelayPolicyprivate final BooleanisActiveprivate final PulsarSessionsessionprivate final BooleanautoCloseprivate Function1<Throwable, Unit>eventExceptionHandlerprivate final Map<CrawlEvents, List<Function<Object>>>listeners
-
Constructor Summary
Constructors Constructor Description AbstractCrawler(PulsarSession session, Boolean autoClose)
-
Method Summary
Modifier and Type Method Description IntegergetId()The crawl id StringgetName()The crawl name Function2<Integer, UrlAware, Duration>getRetryDelayPolicy()Delay policy for retry tasks UnitsetRetryDelayPolicy(Function2<Integer, UrlAware, Duration> retryDelayPolicy)Delay policy for retry tasks BooleanisActive()final PulsarSessiongetSession()final BooleangetAutoClose()Unitpause()Unitresume()Unitreport()UnitonWillLoad(UrlAware url)UnitonLoad(UrlAware url)UnitonLoaded(UrlAware url, WebPage page)Unitclose()-
Methods inherited from class ai.platon.pulsar.common.event.AbstractEventEmitter
count, emit, emit, emit, emit, emit1, emit1, emit1, emit1, getEventExceptionHandler, getListeners, hasListeners, listeners, listeners, off, off, off, off, off, off1, off1, off1, off1, off1, on, on, on, on, on1, on1, on1, on1, once, once, once, once1, once1, once1, setEventExceptionHandler -
Methods inherited from class ai.platon.pulsar.skeleton.crawl.Crawler
await -
Methods inherited from class ai.platon.pulsar.common.event.EventEmitter
hasNormalListeners, hasSuspendListeners, normalListeners, normalListeners, suspendListeners, suspendListeners -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
AbstractCrawler
AbstractCrawler(PulsarSession session, Boolean autoClose)
-
-
Method Detail
-
getRetryDelayPolicy
Function2<Integer, UrlAware, Duration> getRetryDelayPolicy()
Delay policy for retry tasks
-
setRetryDelayPolicy
Unit setRetryDelayPolicy(Function2<Integer, UrlAware, Duration> retryDelayPolicy)
Delay policy for retry tasks
-
getSession
final PulsarSession getSession()
-
getAutoClose
final Boolean getAutoClose()
-
onWillLoad
Unit onWillLoad(UrlAware url)
-
-
-
-