Skip to content

Instantly share code, notes, and snippets.

@mwacc
Created February 20, 2019 05:43
Show Gist options
  • Save mwacc/bbc1bbe7153c8130469cef97191e1d21 to your computer and use it in GitHub Desktop.
Save mwacc/bbc1bbe7153c8130469cef97191e1d21 to your computer and use it in GitHub Desktop.
from aws_xray_sdk.core import xray_recorder
##HIDE @xray_recorder.capture('transfer_funds')
def money_transfer(from_acc_id, to_acc_id, value):
##HIDE xray_recorder.begin_subsegment('lock_funds')
money_locked = enough_and_lock(from_acc_id, value)
##HIDE xray_recorder.end_subsegment()
if money_locked:
##HIDE xray_recorder.begin_subsegment('transfer funds via ' + money_locked.payment_gateway)
transfer_funds(from_acc_id, to_acc_id, value)
##HIDE xray_recorder.end_subsegment()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment