deep-foundation / deep-foundation/deeplinks

Ordering of handler execution

Open
#255 0 comments 0 reactions 1 assignee Claimed by @konard View on GitHub
enhancement
Dominant language
TypeScript
Stars
13
Forks
8
PR merge metrics
No merged PRs in 30d

Description

There should be a way to organize a queue (aka async transactions) of handlers using `deeplinks` as an orchestrator.

```js
const delay = (time) => new Promise(res => setTimeout(() => res(null), time));

while (true) {
const {data: inProgres} = await deep.select({
from: { type_id: {_eq: Post}, id: {_lt: currentId} },
type_id: { _eq: Then },
to: {
_not: {
out: {
type_id: { _in: [Resolved, Rejected] }
}
}
}
});
if (!inProgres.length) break;
await delay(1000);
}
```

At the moment, we are forced to use similar code to organize queue between handlers, that generates multiple queries, and these can be avoided.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.