import time
from metaflow import step, FlowSpec


class BranchFlow(FlowSpec):
    @step
    def start(self):
        print("Starting 👋")
        self.y = 10
        self.next(self.eat, self.drink)

    @step
    def eat(self):
        print("Pausing to eat... 🍜")
        self.x = 10*self.y
        self.next(self.join)

    @step
    def drink(self):
        print("Pausing to drink... 🥤")
        self.x = 20
        self.next(self.join)

    @step
    def join(self, inputs):
        print("Joining 🖇️")
        print("Self.x:", inputs.start.y)
        print("Self.eat.x:", inputs.eat.x)
        print("Self.drink.x:", inputs.drink.x)
        self.next(self.post)

    @step
    def post(self):
        self.next(self.end)

    @step
    def end(self):
        print("Done! 🏁")
        print("Test Message:", self.message)


if __name__ == "__main__":
    BranchFlow()
