Implement progressive query admission, session boundaries and event-driven Studio observations
This commit is contained in:
Vendored
+10
-2
@@ -8,10 +8,18 @@ export const queryFixtureSource = {
|
||||
repository: "https://query-fixture.example.test/source.git",
|
||||
commit: "1".repeat(40),
|
||||
};
|
||||
export async function queryWorkspaceFixture(options: { live?: boolean } = {}) {
|
||||
export async function queryWorkspaceFixture(options: { live?: boolean; snapshot?: boolean } = {}) {
|
||||
const interfaces = new Map<string, InterfaceRevision>();
|
||||
const sources: Record<string, string> = {};
|
||||
function iface(name: string, members: string, parameters = "") {
|
||||
if (options.snapshot) members = members.replaceAll(" ordered", "");
|
||||
if (options.snapshot)
|
||||
for (const member of ["name", "title", "done", "rank", "assignee", "items"])
|
||||
for (const operation of ["get", "resolve"])
|
||||
members = members.replace(
|
||||
`${operation} id "${member}:${operation}";`,
|
||||
`${operation} id "${member}:${operation}" execution snapshot;`,
|
||||
);
|
||||
const text = `${[...interfaces.keys()].map((name) => `import interface ${name};`).join("\n")}
|
||||
interface ${name}${parameters} id "${name}" revision "${name}@1" {${members}}`;
|
||||
sources[name] = text;
|
||||
@@ -117,7 +125,7 @@ export async function queryWorkspaceFixture(options: { live?: boolean } = {}) {
|
||||
${implementation("Task")} ${implementation("Reminder")}
|
||||
conform Tasks as Collection<interface TaskFacts> id "tasks-collection" {
|
||||
private edge Items id "items" {
|
||||
atom Tasks projection items id "items:forward" many ordered;
|
||||
atom Tasks projection items id "items:forward" many${options.snapshot ? "" : " ordered"};
|
||||
interface TaskFacts projection collections id "items:inverse" many;
|
||||
}
|
||||
bind items.resolve to edge Items.items.resolve;
|
||||
|
||||
Reference in New Issue
Block a user