Skip to content

Running well

What keeps a wisp quick and cheap, for you and for the servers it is in, most important first:

  1. Ask for the items you use. Every item is events your wisp handles. A dice wisp needs Post and Commands and hears nothing; a welcome wisp needs Members, not Messages.
  2. Hear, don’t poll. An event reaches your wisp the moment it happens. Reading history on a timer spends your limits to learn what your wisp was already told.
  3. Keep its place (below). A restart then picks up where it left off, instead of reading to catch up.
  4. Change parts, not cards. Key what moves and send a patch. For motion, send live frames: only the newest of a burst goes out, and nothing is stored. A countdown needs nothing at all: its mark counts in the app.
  5. Answer, then work. Answer a run at once and edit your line when slow work is done.
  6. Keep handlers short. A slow event handler holds up that server’s next events. Hand long work to a queue of your own.
  7. Let the library pace you. Add no delays of your own: calls to many channels flow, and lines into one channel take their turn.

Woosh gives every wisp limits, and the library keeps to them for you, waiting a moment when one is reached rather than failing. As your wisp starts they are, in short:

Limit
Calls 100 a second, with bursts up to 500
One server 50 calls a second
One channel 5 new lines a second
One line’s edits 4 a second; live frames in between are dropped for the newest

Answers to runs and presses are paid for by the person who ran or pressed, so a busy command never eats into your limits. The numbers your wisp gets are the ones Woosh tells it as it connects.

Give the library somewhere to keep its place, and a restart or a deploy misses nothing said within 10 minutes:

var options = WispOptions.FromEnvironment() with
{
CursorFile = "wisp-cursor.json",
};
await using var wisp = new WispClient(options);

Or give it your own ICursorStore, such as a row in your database.

Left out, the place is kept in memory: a drop misses nothing, but a restart starts afresh. The place moves past an event only once every handler has finished with it, so after a crash the events that were being handled come again: make handling one twice harmless. Woosh never lets a run take two answers.

Each time your wisp is connected, at the start and after every reconnect, it hears that its line is ready (LineReady; in TypeScript, lineReady). When it says events were missed, it was away longer than 10 minutes: read what you need and carry on (Reading what came before).

Start the new process with the same place kept. When its line is ready, tell the old one to hand over:

await oldWisp.HandOverAsync(); // finishes what it owes, then lets go

People never see your wisp go offline.

Thrown When
ArgumentException a command, option, card or form that breaks a rule, before anything is sent
WispCallException with Refused Woosh said no. Why says why (Acting in a server). Not retried
WispCallException with Limited only when a call could not get through within 30 seconds; Budget names the limit
WispCallException with Failed it may or may not have run, and retrying for 30 seconds did not settle it
WispFatalException from RunAsync: the secret is wrong or was reset

Logs go to the ILoggerFactory you give it, under Woosh.Wisp.

  • A call made while the connection is down waits for it to come back, within the same 30 seconds.
  • A run or a press that arrives after its 15 seconds, after a reconnect, is passed over: it can no longer be answered.

Nothing a person typed is logged.

© 2026 Woosh AS. All rights reserved.