Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: server events #8204

Merged
merged 2 commits into from
Mar 22, 2024
Merged

refactor: server events #8204

merged 2 commits into from
Mar 22, 2024

Conversation

jrasm91
Copy link
Contributor

@jrasm91 jrasm91 commented Mar 22, 2024

  • rename communication to event
  • use event emitter instead of callbacks for config update (cross-process event)
  • user event emitter instead of callbacks for websocket connection event (in-process event)

Copy link

cloudflare-pages bot commented Mar 22, 2024

Deploying immich with  Cloudflare Pages  Cloudflare Pages

Latest commit: dd169e9
Status: ✅  Deploy successful!
Preview URL: https://19f56b0d.immich.pages.dev
Branch Preview URL: https://refactor-server-events.immich.pages.dev

View logs

export class CommunicationRepository
implements OnGatewayConnection, OnGatewayDisconnect, OnGatewayInit, ICommunicationRepository
{
private logger = new ImmichLogger(CommunicationRepository.name);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is all basically gone - no more need to store, register, and invoke callbacks.

@jrasm91 jrasm91 marked this pull request as ready for review March 22, 2024 22:08
Copy link
Member

@danieldietzler danieldietzler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

server/src/interfaces/event.interface.ts Outdated Show resolved Hide resolved
@jrasm91 jrasm91 merged commit 6e93ddf into main Mar 22, 2024
24 checks passed
@jrasm91 jrasm91 deleted the refactor/server-events branch March 22, 2024 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants