Skip to content

feat: add EventAutoloader for live event streaming from directories/e…#857

Open
Shivansh1205 wants to merge 1 commit intoHSF:mainfrom
Shivansh1205:feat/event-autoloader
Open

feat: add EventAutoloader for live event streaming from directories/e…#857
Shivansh1205 wants to merge 1 commit intoHSF:mainfrom
Shivansh1205:feat/event-autoloader

Conversation

@Shivansh1205
Copy link
Copy Markdown
Contributor

Summary

Implements the ability to have Phoenix auto-load new events as they are pushed or published to a directory, as discussed in the issue.

Three source strategies

1. apache-listing (polling)

Fetches an Apache/nginx directory index and parses linked .json/.xml files — directly compatible with the JSROOT file listing format at https://root.cern.ch/js/files/. Tracks seen files so each event is only loaded once.

2. rest-endpoint (polling)

Polls any REST API including AWS Lambda. Accepts { url }, { data }, or { events } response shapes.

3. sse (push)

Connects to a Server-Sent Events stream. Zero polling overhead — server pushes events as they happen.

Usage

// Apache directory (JSROOT-style)
this.autoloaderService.start({
  type: 'apache-listing',
  url: 'https://my-server/events/',
  intervalMs: 5000,
});

// AWS Lambda / REST
this.autoloaderService.start({
  type: 'rest-endpoint',
  url: 'https://lambda-url.amazonaws.com/latest-event',
});

// SSE push
this.autoloaderService.start({ type: 'sse', url: '/api/events/stream' });

// Stop
this.autoloaderService.stop();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant