Class StreamingCrawler
-
- All Implemented Interfaces:
-
ai.platon.pulsar.common.event.EventEmitter,ai.platon.pulsar.skeleton.crawl.Crawler,java.lang.AutoCloseable
public class StreamingCrawler extends AbstractCrawler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classStreamingCrawler.Companion
-
Field Summary
Fields Modifier and Type Field Description private final IntegernumBrowserContextsprivate final IntegernumPrivacyContextsprivate final IntegernumMaxOpenTabsprivate final IntegerfetchConcurrencyprivate final Integerconcurrencyprivate final DurationoutOfWorkTimeoutprivate final DurationfetchTaskTimeoutprivate final DurationidleTimeprivate final BooleanisOutOfWorkprivate final BooleanisSmartRetryEnabledprivate final BooleanisIdleprivate final BooleanisActiveprivate StringjobNameprivate Sequence<UrlAware>urlsprivate final Integeridprivate final Stringnameprivate Function2<Integer, UrlAware, Duration>retryDelayPolicyprivate final PulsarSessionsessionprivate final BooleanautoCloseprivate Function1<Throwable, Unit>eventExceptionHandlerprivate final Map<CrawlEvents, List<Function<Object>>>listenerspublic final static StreamingCrawler.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description StreamingCrawler(Sequence<UrlAware> urls, PulsarSession session, Boolean autoClose)
-
Method Summary
Modifier and Type Method Description final IntegergetNumBrowserContexts()final IntegergetNumPrivacyContexts()final IntegergetNumMaxOpenTabs()final IntegergetFetchConcurrency()final IntegergetConcurrency()final DurationgetOutOfWorkTimeout()The out of work timeout. final DurationgetFetchTaskTimeout()final DurationgetIdleTime()final BooleanisOutOfWork()final BooleanisSmartRetryEnabled()final BooleanisIdle()BooleanisActive()final StringgetJobName()The job name. final UnitsetJobName(String jobName)The job name. final Sequence<UrlAware>getUrls()The url sequence final UnitsetUrls(Sequence<UrlAware> urls)The url sequence Unitrun()Run the crawler. Unitrun(CoroutineScope scope)Run the crawler in the given coroutine scope. Unitreport()Unitawait()Wait until all tasks are done. final Unitquit()Quit the crawl loop. Unitclose()Quit and close the crawl loop. -
Methods inherited from class ai.platon.pulsar.skeleton.crawl.impl.AbstractCrawler
getAutoClose, getId, getName, getRetryDelayPolicy, getSession, onLoad, onLoaded, onWillLoad, pause, resume, setRetryDelayPolicy -
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.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
-
StreamingCrawler
StreamingCrawler(Sequence<UrlAware> urls, PulsarSession session, Boolean autoClose)
-
-
Method Detail
-
getNumBrowserContexts
final Integer getNumBrowserContexts()
-
getNumPrivacyContexts
final Integer getNumPrivacyContexts()
-
getNumMaxOpenTabs
final Integer getNumMaxOpenTabs()
-
getFetchConcurrency
final Integer getFetchConcurrency()
-
getConcurrency
final Integer getConcurrency()
-
getOutOfWorkTimeout
final Duration getOutOfWorkTimeout()
The out of work timeout.
-
getFetchTaskTimeout
final Duration getFetchTaskTimeout()
-
getIdleTime
final Duration getIdleTime()
-
isOutOfWork
final Boolean isOutOfWork()
-
isSmartRetryEnabled
final Boolean isSmartRetryEnabled()
-
getJobName
final String getJobName()
The job name.
-
setJobName
final Unit setJobName(String jobName)
The job name.
-
-
-
-