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

Centralized Callback Manager #77

Merged
merged 7 commits into from
Jun 4, 2024
Merged

Centralized Callback Manager #77

merged 7 commits into from
Jun 4, 2024

Conversation

momintlh
Copy link
Collaborator

@momintlh momintlh commented May 23, 2024

  • Added CallbackManager.cs which will replace all of the Dictionaries/Lists we are using for handling callbacks for different parts of playroom
  • Currently tested with InsertCoin's callbacks, which does not require any parameters: Type Action (void)

TODO:

  • Test with other types: Action< string > (Tested and working with WaitForState)
  • Action<string, string>
  • Test with persistent callbacks (for RPCs)

Based On #75
Relates to #40

@momintlh momintlh requested a review from SaadBazaz May 23, 2024 16:10
@SaadBazaz
Copy link
Collaborator

We should be pushing out a callback manager which we can use for WaitForState, solving the original problem in #75 .
If we implement WaitForState with this new CallbackManager, we can keep improving it later on and incrementally replace other callbacks.

Copy link
Collaborator

@SaadBazaz SaadBazaz left a comment

Choose a reason for hiding this comment

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

Looks good.


private static string GenerateKey()
{
return Guid.NewGuid().ToString();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you think timestamps can serve as a good enough key, or can there be collisions? Just a thought. Because that way you can keep track of the callbacks stored, according to time.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe give this file and folder an appropriate name too?
(instead of src/index.js)

@momintlh momintlh merged commit 2f2896d into main Jun 4, 2024
2 checks passed
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.

2 participants