Quickstart
Enqueue a job with the v1 SDKs and see a worker run it.
With sextant start running, enqueue a job from Node or Python and register a handler with the same SDK.
NodeTypeScript
import Sextant from 'sextant';
const client = new Sextant({ key: process.env.SEXTANT_KEY });
client.handle('send-receipt', async (payload) => {
await mailer.send(payload.to, 'Your receipt');
});
await client.enqueue('send-receipt', { to: '[email protected]' }, { retries: 3, delay: 60 });
client.work();PythonPython
import os
import sextant
client = sextant.Client(key=os.environ["SEXTANT_KEY"])
@client.handle("send-receipt")
def send_receipt(payload):
mailer.send(payload["to"], "Your receipt")
client.enqueue("send-receipt", {"to": "[email protected]"}, retries=3, delay=60)
client.work()delay is in seconds. retries is the number of retries after the first attempt, so retries=3 allows four attempts.
Check the result
Shell
sextant jobs --status done