asadm / playroom-unity

9 stars 1 forks source link

[Feature-Request]: A central callback handling system #75

Closed asadm closed 4 weeks ago

asadm commented 1 month ago

What do you want to see?

We keep adding more complexity by handling callback array for each feature individually. We also dont support multiple callbacks (as in js version) for many features like WaitForState which just has one global callback holder?

Can we abstract away the callback system such that:

  1. a callback handler is stored in a global dictionary against a random id
  2. the id is the thing sent to jslib
  3. the jslib sends data back along with callback id
  4. we retrieve the handler back from global dict and route to the right id.

Link to original discussion

No response

SaadBazaz commented 1 month ago

Adds to #40

SaadBazaz commented 4 weeks ago

Resolved in #77 (initial implementation) and #80 (improvement for RPC)