This change creates a Thruway-specific feature that allows for the hooking of RPCs.
A client can register an RPC that will receive calls for an already existing RPC. The client can then choose to service the call itself or it can call the original hooked RPC (either using it's own session context or the original session's context).
The use case for this feature are similar to hooking in any other environment. (debugging, extending functionality without changing the original RPC, etc.)
Usage:
Hook an existing RPC by registering a new RPC with the same name and the option: 'x_thruway_hook' => true. This registration will then receive all calls to that RPC.
These INVOCATIONs can be handled as a normal RPC if desired. The existing registration will not receive the INVOCATIONs.
The hooked registration can also call the underlying RPC by making a call with the option: ['x_thruway_call_hooked' => (object)[ 'registration_id' => $hookRegistrationId ]] and can call the underlying RPC with the session context of the caller using:
This change creates a Thruway-specific feature that allows for the hooking of RPCs.
A client can register an RPC that will receive calls for an already existing RPC. The client can then choose to service the call itself or it can call the original hooked RPC (either using it's own session context or the original session's context).
The use case for this feature are similar to hooking in any other environment. (debugging, extending functionality without changing the original RPC, etc.)
Usage:
Hook an existing RPC by registering a new RPC with the same name and the option:
'x_thruway_hook' => true
. This registration will then receive all calls to that RPC.These
INVOCATION
s can be handled as a normal RPC if desired. The existing registration will not receive theINVOCATION
s.The hooked registration can also call the underlying RPC by making a call with the option:
['x_thruway_call_hooked' => (object)[ 'registration_id' => $hookRegistrationId ]]
and can call the underlying RPC with the session context of the caller using: