Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _handle_callback(kernel, callback):
# need to handle get, set requests here as well as invoke requests
if callback.invoke:
obj = _reference_map.resolve_id(callback.invoke.objref.ref)
method = getattr(obj, callback.cookie)
hydrated_args = [_recursize_dereference(kernel, a) for a in callback.invoke.args]
return method(*hydrated_args)
elif callback.get:
obj = _reference_map.resolve_id(callback.get.objref.ref)
return getattr(obj, callback.cookie)
elif callback.set:
obj = _reference_map.resolve_id(callback.set.objref.ref)
hydrated_value = _recursize_dereference(kernel, callback.set.value)
return setattr(obj, callback.cookie, hydrated_value)
else:
raise JSIIError("Callback does not contain invoke|get|set")
def _handle_callback(kernel, callback):
# need to handle get, set requests here as well as invoke requests
if callback.invoke:
obj = _reference_map.resolve_id(callback.invoke.objref.ref)
method = getattr(obj, callback.cookie)
hydrated_args = [_recursize_dereference(kernel, a) for a in callback.invoke.args]
return method(*hydrated_args)
elif callback.get:
obj = _reference_map.resolve_id(callback.get.objref.ref)
return getattr(obj, callback.cookie)
elif callback.set:
obj = _reference_map.resolve_id(callback.set.objref.ref)
hydrated_value = _recursize_dereference(kernel, callback.set.value)
return setattr(obj, callback.cookie, hydrated_value)
else:
raise JSIIError("Callback does not contain invoke|get|set")
def _handle_callback(kernel, callback):
# need to handle get, set requests here as well as invoke requests
if callback.invoke:
obj = _reference_map.resolve_id(callback.invoke.objref.ref)
method = getattr(obj, callback.cookie)
hydrated_args = [_recursize_dereference(kernel, a) for a in callback.invoke.args]
return method(*hydrated_args)
elif callback.get:
obj = _reference_map.resolve_id(callback.get.objref.ref)
return getattr(obj, callback.cookie)
elif callback.set:
obj = _reference_map.resolve_id(callback.set.objref.ref)
hydrated_value = _recursize_dereference(kernel, callback.set.value)
return setattr(obj, callback.cookie, hydrated_value)
else:
raise JSIIError("Callback does not contain invoke|get|set")