const order = await create();
// Match nearest courier
function matchCourier(o)
await dispatch(order.id);
if (status === "delivered")
const route = optimize();
return new Promise(res => {})
for (let c of active)
export class Engine
import { motor } from
// 2,847 couriers active
throw new Error("OOR");
const eta = distance / 42;
await redis.set(key, val);
tracking.start(order);
if (eta < 15) priority++;
response.json({ ok: true });
db.couriers.findActive();
await geofence(pickup);
metrics.track("created");
const active = 2847;
async function tick()
socket.emit("assigned");
// route nightly @ 03:00
queue.push({ order });
const total = couriers.length;
if (!order) throw;
await sleep(100);
console.log("dispatched");
// real-time tracking ON
order.priority = 2;
const bbox = pickup.box();
pickup.geohash();
await kafka.produce();
return { ok: true };
const order = await create();
// Match nearest courier
function matchCourier(o)
await dispatch(order.id);
if (status === "delivered")
const route = optimize();
return new Promise(res => {})
for (let c of active)
export class Engine
import { motor } from
// 2,847 couriers active
throw new Error("OOR");
const eta = distance / 42;
await redis.set(key, val);
tracking.start(order);
if (eta < 15) priority++;
response.json({ ok: true });
db.couriers.findActive();
await geofence(pickup);
metrics.track("created");
const active = 2847;
async function tick()
socket.emit("assigned");
// route nightly @ 03:00
queue.push({ order });
const total = couriers.length;
if (!order) throw;
await sleep(100);
console.log("dispatched");
// real-time tracking ON
order.priority = 2;
const bbox = pickup.box();
pickup.geohash();
await kafka.produce();
return { ok: true };
const order = await create();
// Match nearest courier
function matchCourier(o)
await dispatch(order.id);
if (status === "delivered")
const route = optimize();
return new Promise(res => {})
for (let c of active)
export class Engine
import { motor } from
// 2,847 couriers active
throw new Error("OOR");
const eta = distance / 42;
await redis.set(key, val);