def orchestrator_function()

in Sample-Code-Snippets/Python/Azure Function Example/example_orchestrator.py [0:0]


def orchestrator_function(context: df.DurableOrchestrationContext):

    # Grab the message incoming from EventHub
    incoming_message = context.get_input()
    # Check if message says Left or Right...
    direction = yield context.call_activity("check_state", incoming_message)
    result = False
    match(direction):
        case "left":
            result = yield context.call_activity("left_only", incoming_message)
        case "right":
            result = yield context.call_activity("right_only", incoming_message)
    return result