method
set_service_hook
v2_1_10 -
Show latest stable
-
0 notes -
Class: BasicServer
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (38)
- 2_2_9 (0)
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
set_service_hook(&handler)
public
A service-hook is called for each service request (RPC).
You can use a service-hook for example to wrap existing methods and catch exceptions of them or convert values to values recognized by XMLRPC.
You can disable it by passing nil as the handler parameter.
The service-hook is called with a Proc object along with any parameters.
An example:
server.set_service_hook {|obj, *args| begin ret = obj.call(*args) # call the original service-method # could convert the return value rescue # rescue exceptions end }