Created
June 11, 2014 23:47
-
-
Save dsuch/1624cb5066779551baf5 to your computer and use it in GitHub Desktop.
invoke_async service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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