Re: [Twisted-Python] Monitoring configuration of twisted calls.

Actually, I think I just figured it out: def wrapper(*args, **kw): func = self._getProxy(URL["url"], URL["user"], URL["passwd"]).callRemote(remote_method, *args, **kw) func.addCallback(self.handleSuccess, method) return func return wrapper All I needed was to add a callback! Steve ----- Original Message ---- From: Jean-Paul Calderone <exarkun@divmod.com> To: Twisted general discussion <twisted-python@twistedmatrix.com> Sent: Thursday, August 28, 2008 4:01:10 PM Subject: Re: [Twisted-Python] Monitoring configuration of twisted calls. On Thu, 28 Aug 2008 06:25:40 -0700 (PDT), Steve Lewis <spiritualmechanic@yahoo.com> wrote:
This is probably the best approach. `_getFunction´ should probably be a public method. Its docstring directs users to override it, which is rather in conflict with it being private. To overcome the problem of the function not actually being called inside `_getFunction´, you just need to apply a wrapper to the function which is looked up. The wrapper can mark the call as successful. For example: def _getFunction(self, functionPath): f = XMLRPC._getFunction(self, functionPath) def wrapper(*a, **kw): result = f(*a, **kw) self._monitor[functionPath] = True return result return wrapper I'd also recommend filing a ticket to make `_getFunction´ public, so that you don't have to rely on a private hook to make this work. Jean-Paul _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
participants (1)
-
Steve Lewis