forked from trailblazer/trailblazer-activity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NOTES
39 lines (26 loc) · 1.38 KB
/
NOTES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# 2.2
* The `Polarizations` classes, e.g. in `FastTrack` could be steps in the normalizer? so we wouldn't need `reverse_merge`.
# NOT lowest level. if you need that, use your own proc.
# TODO: how do we track what goes into the callable?
# adjust what goes into it (e.g. without direction or with kw args)?
# pre contract -> step -> post contract (are these all just steps, in "mini nested pipe"?)
#
#
# aka "Atom".
def self.Task(instance: :context, method: :call, id:nil)
# * ingoing contract (could be implemented as a nested pipe with 3 steps. that would allow us
# to compile it to native ruby method calls later)
->(direction, options, **flow_options) {
instance = flow_options[:context] if instance==:context # TODO; implement different :context (e.g. :my_context).
# * incoming args
# step_args = [args] # TODO: overridable.
step_args = [ options, **options ]
# ** call the actual thing
res = instance.send(method, *step_args) # what goes in? kws?
# * interpret result (e.g. true=>Right) (should we keep doing that in the tie? so the op has it easier with success, etc?)
# * outgoing contract
# * outgoing args
[ *res, flow_options ]
# * tracing: incoming, outgoing, direction, etc. - do we want that in tasks, too?
}
end