Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BCDD::Result::Transitions::Listener #30

Merged
merged 10 commits into from
Jan 30, 2024
Merged

Conversation

serradura
Copy link
Member

@serradura serradura commented Jan 28, 2024

Added

  • BCDD::Result.configuration - Accept freeze option (default: true). When true, the configuration will be frozen after the block execution.

  • BCDD::Result.config.transitions - Add transitions feature configuration.

    • config.transitions.listener = - Set a listener to be called during the result transitions tracking. It must be a class that includes BCDD::Result::Transitions::Listener.
    • config.transitions.trace_id = - Set a lambda (must have arity 0) to be called to get a trace id. Use to correlate different or the same operation (executed multiple times).
  • Add transitions metadata property :ids_matrix. It is a simplification of the :ids_tree property. The matrix rows are the direct transitions from the root transition block, and the columns are the transitions nested from the direct transitions.

    # ids_matrix       # {
    0 | 1 | 2 | 3 | 4  #   0 => [0, 0],
    - | - | - | - | -  #   1 => [1, 1],
    0 |   |   |   |    #   2 => [1, 2],
    1 | 1 | 2 |   |    #   3 => [2, 1],
    2 | 3 |   |   |    #   4 => [3, 1],
    3 | 4 | 5 | 6 | 7  #   5 => [3, 2],
    4 | 8 |   |   |    #   6 => [3, 3],
                       #   7 => [3, 4],
                       #   8 => [4, 1]
                       # }

Changed

  • (BREAKING) Move transition :source from :and_then to :result property.

  • (BREAKING) Rename transitions metadata property :tree_map to :ids_tree.

    # ids_tree #
    0          # [0, [
    |- 1       #   [1, [[2, []]]],
    |  |- 2    #   [3, []],
    |- 3       #   [4, [
    |- 4       #     [5, []],
    |  |- 5    #     [6, [[7, []]]]
    |  |- 6    #   ]],
    |     |- 7 #   [8, []]
    |- 8       # ]]

@serradura serradura added the enhancement New feature or request label Jan 28, 2024
@serradura serradura added this to the 1.0.0.beta1 milestone Jan 28, 2024
@serradura serradura self-assigned this Jan 28, 2024
@serradura serradura force-pushed the feat/transitions-listener branch 15 times, most recently from 4790668 to 429aa91 Compare January 29, 2024 01:54
@serradura serradura force-pushed the feat/transitions-listener branch from 429aa91 to 9f949f8 Compare January 29, 2024 01:59
@serradura serradura changed the title [WIP] Add BCDD::Result transitions listener Add BCDD::Result transitions listener Jan 29, 2024
@serradura serradura force-pushed the feat/transitions-listener branch from 9f949f8 to f44cddd Compare January 29, 2024 02:05
@serradura serradura force-pushed the feat/transitions-listener branch 3 times, most recently from 3a363dc to 242a769 Compare January 29, 2024 13:40
@serradura serradura force-pushed the feat/transitions-listener branch from 242a769 to c0bec0f Compare January 30, 2024 00:14
@serradura serradura force-pushed the feat/transitions-listener branch 4 times, most recently from 74ae057 to aff628a Compare January 30, 2024 13:49
@serradura serradura force-pushed the feat/transitions-listener branch from aff628a to f35f1a9 Compare January 30, 2024 13:56
@serradura serradura force-pushed the feat/transitions-listener branch from f35f1a9 to 5d7cd1d Compare January 30, 2024 23:40
@serradura serradura marked this pull request as ready for review January 30, 2024 23:42
@serradura serradura merged commit 22374b0 into main Jan 30, 2024
6 checks passed
@serradura serradura deleted the feat/transitions-listener branch January 30, 2024 23:42
@serradura serradura changed the title Add BCDD::Result transitions listener Add BCDD::Result::Transitions::Listener Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant