MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / events

Function events

ui/src/lib/adapter.ts:453–464  ·  view source on GitHub ↗
(handlers)

Source from the content-addressed store, hash-verified

451 write<WireTrails>(`api/trails/${encodeURIComponent(id)}`, 'DELETE', undefined, signal),
452
453 events(handlers) {
454 if (typeof EventSource === 'undefined') return () => {};
455 const stream = new EventSource(`${base}api/events`);
456 stream.addEventListener('hello', (event) => handlers.hello(parse(event)));
457 stream.addEventListener('changed', (event) => handlers.changed(parse(event)));
458 stream.addEventListener('index', (event) => handlers.index(parse(event)));
459 stream.addEventListener('degraded', (event) => handlers.degraded(parse(event)));
460 // The backoff belongs to the caller, not here: an adapter that retried on
461 // its own would race the one that already does and double the requests.
462 stream.addEventListener('error', () => handlers.error());
463 return () => stream.close();
464 },
465 };
466}
467

Callers

nothing calls this directly

Calls 7

helloMethod · 0.80
changedMethod · 0.80
indexMethod · 0.80
degradedMethod · 0.80
parseFunction · 0.70
errorMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected