Skip to content

Add flow control to protocol #3

@floesche

Description

@floesche

A (much) later version of the protocol might want to use flow control. For example, if a type or plugin has a store_as value, the implementation would store the return value from the function or plugin as that value. Let's say the flyris plugin has a get_mm method, we could use that the following way:

block:
    conditions:
        - id: "active_background"
          commands:
            - plugins: "flyris"
            - method: "get_mm"
            - store_as: "open_width"
        - type: "if"
          variable: "open_width"
          condition: "> 50"
          then:
            - plugins: "flyris"
              method: "open_mm"
              params:
                  width: "30mm"
          else
            - plugins: "flyris"
              method: "open_mm"
              params:
                  width: "30mm"

Switch statements etc could be implemented in a similar way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions