Skip to content

Centralized Callback Manager#77

Merged
momintlh merged 7 commits intomainfrom
improved-callback-handler
Jun 4, 2024
Merged

Centralized Callback Manager#77
momintlh merged 7 commits intomainfrom
improved-callback-handler

Conversation

@momintlh
Copy link
Copy Markdown
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
Comment thread Assets/PlayroomKit/CallbackManager.cs Outdated
Comment thread Assets/PlayroomKit/CallbackManager.cs Outdated
@SaadBazaz
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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)

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