ISessionPool
Implemented by
Index
Methods
Methods
getSession
Returns a usable ISession. Without an id, the pool decides which session to return (creating a new one when appropriate). With an id, the pool returns the matching session if it is still usable.
In case the
SessionPoolcannot provide a usable session given the configuration, this method may returnundefined.Parameters
optionalsessionId: string
Returns Promise<undefined | ISession>
Minimal contract that any object passed to a crawler as its
sessionPooloption must satisfy.Crawlers only depend on a single method of the built-in
SessionPool:getSession()/getSession(id)to hand out an ISession for a request. Lifecycle (reset, teardown) is the responsibility of whoever owns the pool — since a user-supplied pool is never owned by the crawler, the crawler never tears it down.Implement this interface to plug a custom session-management strategy into any Crawlee crawler — for example a remote, multi-process pool, a database-backed pool, or a thin wrapper around the built-in
SessionPoolwith different rotation rules.