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

client:Implemented the enqueuing mechanism for clients #64

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

ritwik-69
Copy link
Contributor

@ritwik-69 ritwik-69 commented Jun 4, 2024

fixes: #60

Description

Created two functions that pushes the event object into the event queue of a specific client id.
The second Function sends the each event of the given client id to all the eligible client id (i.e only if response object is available).

Motivation and Context

[Explain the motivation behind these changes and provide any relevant context.]

How to Test

[Describe the steps to test the changes made in this pull request.]

Related Issues

[If applicable, mention any related issues or pull requests.]

Checklist

  • I have tested these changes locally.
  • I have reviewed the code and ensured it follows the project's coding guidelines.
  • I have updated the documentation, if necessary.
  • I have assigned reviewers to this pull request.

Screenshots (if applicable)

[If your changes include any visual updates, provide screenshots here.]

@@ -31,9 +31,19 @@ export function getClient(clientId: ClientId) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function scheduleSend(clientId: ClientId, event: AppEvent) {
//todo: Enqueue the event for sending.
eventQueue.get(clientId)?.push(event);
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function doSendEvent(clientId: ClientId) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not a part of this PR.

@@ -31,9 +31,19 @@ export function getClient(clientId: ClientId) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function scheduleSend(clientId: ClientId, event: AppEvent) {
//todo: Enqueue the event for sending.
eventQueue.get(clientId)?.push(event);
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can remove the todo comment and the eslint directive

Copy link

vercel bot commented Jun 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
multiplayer-uno ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2024 2:08pm

@ritwik-69
Copy link
Contributor Author

@kuv2707 done with the changes

@ritwik-69
Copy link
Contributor Author

@kuv2707 edited the commit message.

@kuv2707
Copy link
Collaborator

kuv2707 commented Jun 6, 2024

@ritwik-69 This can be merged once the merge conflicts are resolved.

This commits creates a function that pushes the event object
 into the event queue of a specific client id.

 Fixes:shivansh-bhatnagar18#60
@kuv2707 kuv2707 merged commit 3609ea5 into shivansh-bhatnagar18:master Jun 10, 2024
8 checks passed
@kuv2707
Copy link
Collaborator

kuv2707 commented Jun 10, 2024

Merged, thanks @ritwik-69

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.

Implement the enqueuing mechanism for clients
2 participants