export class MyDO extends DurableObject {
async slowWrite() {
return this.ctx.blockConcurrencyWhile(async () => {
await fetch('https://slow-api.com'); // 15 seconds
await this.ctx.storage.put('key', 'value');
});
}
async fastRead() {
return await this.ctx.storage.get('key');
}
}
export class MyDO extends DurableObject {
async slowWrite() {
return this.ctx.blockConcurrencyWhile(async () => {
await fetch('https://slow-api.com'); // 15 seconds
await this.ctx.storage.put('key', 'value');
});
}
async fastRead() {
return await this.ctx.storage.get('key');
}
}