Pulsar

Self Invocation Interval (sec)

Configure the frequency (in seconds) at which the engine triggers self-invocations.

The selfInvocationIntervalSec property sets how frequently (in seconds) the Pulsar engine triggers its self-invocation cycle to process queued work.

Usage

Pass selfInvocationIntervalSec inside the engine configuration block:

const engine = new Pulsar({
  runtime: PulsarRuntime.SERVERLESS,
  engine: {
    selfURL: "[http://host.docker.internal:9999/process-job](http://host.docker.internal:9999/process-job)",
    selfInvocationMethod: "auto_using_pgnet",
    selfInvocationIntervalSec: 5, 
  },
});

Configuration Reference

  • Default: 1
  • Minimum: 1

Recommendations & Workload Pacing

  • Default (1 second): Recommended for latency-sensitive workloads or multiple interval-driven queues with frequent, predictable tasks. Jobs are picked up almost immediately.
  • Higher intervals (e.g., 5+ seconds): Ideal when you want to reduce host invocation costs and rate limits. This trades off job pickup latency in exchange for significantly fewer total engine invocations over time.

Estimated Monthly Invocations

The lower you set the selfInvocationIntervalSec, the higher the total number of monthly invocations your serverless function will execute.

1-Second Interval

Monthly Invocations=1×60×60×24×30=2,592,000\text{Monthly Invocations} = 1 \times 60 \times 60 \times 24 \times 30 = 2,592,000

5-Seconds Interval

Monthly Invocations=(15)×60×60×24×30=518,400\text{Monthly Invocations} = \left(\frac{1}{5}\right) \times 60 \times 60 \times 24 \times 30 = 518,400

Depending on your serverless hosting provider or database execution layer, total monthly invocations may vary slightly due to network latency and platform execution overhead.

On this page