Skip to content

Instantly share code, notes, and snippets.

@dsuch
Created June 11, 2014 23:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsuch/1624cb5066779551baf5 to your computer and use it in GitHub Desktop.
Save dsuch/1624cb5066779551baf5 to your computer and use it in GitHub Desktop.
invoke_async service
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
# Zato
from zato.server.service import Service
class WS(Service):
def before_handle(self):
self.logger.info('11 TEST_LOG: Entering {}'.format(self.name))
def handle(self):
self.logger.info('11 TEST_LOG: {} handle'.format(self.name))
cid = self.invoke_async('test-random-log.first-step', self.request.payload)
def finalize_handle(self):
self.logger.info('11 TEST_LOG: {} took {} ms'.format(self.name, self.processing_time))
class FirstStep(Service):
def before_handle(self):
self.logger.info('22 TEST_LOG: Entering {}'.format(self.name))
def handle(self):
self.logger.info('22 TEST_LOG: {} handle'.format(self.name))
self.invoke_async('test-random-log.second-step', self.request.payload)
def finalize_handle(self):
self.logger.info('22 TEST_LOG: {} took {} ms'.format(self.name, self.processing_time))
class SecondStep(Service):
def before_handle(self):
self.logger.info('33 TEST_LOG: Entering {}'.format(self.name))
def handle(self):
self.logger.info('33 TEST_LOG: {} handle'.format(self.name))
def finalize_handle(self):
self.logger.info('33 TEST_LOG: {} took {} ms'.format(self.name, self.processing_time))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment