Docs / Core Runtime
v1.0.2Latest / April 2026

Event Loop

Gun supports the async patterns backend JavaScript uses most often: promises, async functions, timers, and request callbacks.

Supported patterns

Use async and await for ordinary asynchronous work:

Promise chains are supported too, but async functions usually produce clearer diagnostics.

Timers

Timer APIs work for common scheduling patterns:

Avoid using timers as a substitute for durable queues.

Request handlers

HTTP handlers can be synchronous or async:

Keep handler state explicit.

Practical limits

Gun is best with async flows that are visible in the source graph.