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

feat: long poll api endpoint and user manager #46

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

oshinongit
Copy link
Contributor

@oshinongit oshinongit commented Mar 25, 2024

-Added a user manager class. One instance of this class is created for every line. There is an event emitter which triggers every time a add/remove function is called on the user manager instance.
-Added a heartbeat endpoint that only resolves if there is a change to the list of users. I am thinking we can use this to implement a long polling from the client. The client will make one request that will linger until it received an updated user list. The client will then immediately make a new request.
-Updated unit tests

@oshinongit oshinongit force-pushed the feat-poll-active-client branch 2 times, most recently from 1ebd5ab to 2bc6010 Compare March 26, 2024 08:54
@oshinongit oshinongit changed the title feat: heartbeat api endpoint and user manager feat: long poll api endpoint and user manager Mar 26, 2024
@oshinongit oshinongit requested a review from martinstark March 26, 2024 08:57
@oshinongit oshinongit force-pushed the feat-poll-active-client branch from 2bc6010 to d299c8f Compare March 26, 2024 09:12
@@ -129,37 +131,39 @@ export const SmbEndpointDescription = Type.Object({

export const Endpoint = Type.Object({
endpointId: Type.String(),
sessionDescription: SmbEndpointDescription
sessionDescription: SmbEndpointDescription,
isActive: Type.Boolean()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The isActive attribute on the Endpoint type might be redundant since we will be tracking active status for each user object.

Copy link
Contributor Author

@oshinongit oshinongit Mar 26, 2024

Choose a reason for hiding this comment

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

Actually I change my mind on this. The attribute will be required when we implement the heartbeat logic. A user might have started a new session, in which case the connection itself will still need to be cleaned up if not active.

@oshinongit oshinongit merged commit 12a21ef into main Mar 27, 2024
4 checks passed
@oshinongit oshinongit deleted the feat-poll-active-client branch March 27, 2024 08:13
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