You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Customarily, callbacks take an additional user data parameter so that closures can be used as callbacks. This is the case with, for example, JsMemoryAllocationCallback. However, JsThreadServiceCallback takes no such parameter (do not confuse this with its callbackState parameter, which is not user data rather engine-provided data for the work item callback).
I wouldn't want to break the existing JsCreateRuntime, so to implement this would involve either:
a) Making the existing function somehow able to accept either just a callback OR a struct that points to both the "state" and the callback - with some way of checking which it was receiving (maybe via an attribute?)
OR
b) Making an additional API for if people want a state
Customarily, callbacks take an additional user data parameter so that closures can be used as callbacks. This is the case with, for example,
JsMemoryAllocationCallback
. However,JsThreadServiceCallback
takes no such parameter (do not confuse this with itscallbackState
parameter, which is not user data rather engine-provided data for the work item callback).Ideally the API would be:
where the runtime would pass
threadServiceCallbackState
tothreadService
whenever it’s called.The text was updated successfully, but these errors were encountered: