Created
February 20, 2019 05:10
-
-
Save mwacc/b9f07e94fc3be411feac95a6a2280806 to your computer and use it in GitHub Desktop.
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
from aws_xray_sdk.core import xray_recorder | |
@xray_recorder.capture('transfer_funds') | |
def money_transfer(from_acc_id, to_acc_id, value): | |
xray_recorder.begin_subsegment('lock_funds') | |
money_locked = enough_and_lock(from_acc_id, value) | |
xray_recorder.end_subsegment() | |
if money_locked: | |
xray_recorder.begin_subsegment('transfer funds via ' + money_locked.payment_gateway) | |
transfer_funds(from_acc_id, to_acc_id, value) | |
xray_recorder.end_subsegment() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment