forked from brandonbloom/asyncx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes
151 lines (108 loc) · 3.07 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
Closing: How should I handle "disposable" sources?
TODO: Schedulers
TODO: all my if/when/whatever operations don't handle nil vs false
Inspired by "LINQ Operators by Categories" for Microsoft Rx
http://msdn.microsoft.com/en-us/library/hh242961(v=vs.103).aspx
Individual Function Notes
Generate
Renamed to iterate
Missing a bunch of overloads
Do we need them?
I implemented the pred overload. Is that needed?
TODO: Scheduling
no-predicate?
Defer
Seems not to make sense given the blocking/parking behavior of channels
Range
Msft went with start+count instead of [start, end)
Scheduling
Overloads to match clojure.core/range
FromAsyncPattern
Not implemented
begin/end async pairs are not common on JVM or in Clojure
FromEvent
There is no standard event pattern, so require sub/unsub functions
Call unsub on channel close... but close doesn't dispatch puts
TODO: I couldn't get this to work correctly.
Events are "hot" sources
ToObservable
I called this "pull"
TODO: scheduling
ToEnumerable
TODO
Called: seq!!
Infinite lazy seq? Or ends on nil?
Amb
This one came across really nicely!
Concat
This one worked really nice too!
StartsWith
I'm pretty sure that this is just concat+pull
Merge
Called this "weave" because merge implies maps in Clojure
Not fan-in because there are alternative fan-in strategies
ie. close when any port is closed
Consider the concurrency limiting overloads
Repeat
TODO: scheduling
Overloaded by type to create both cycle and repeat
Zip
Do like clojure: variadic map
Let
TODO: What is this?
Prune:
TODO: What is this?
Publish
This is awesome.
Need to think more about hot & cold sources.
Replay
Consider: unbuffered and time-limited buffering
TODO: BUG: every-other message from a hot source is lost
This seems to be a more general problem with hot sources... what to do?
Aggregate
This is clearly reduce!
Count
Easy one!
Min, Max
Even easier! Maybe so easy, that it's worth treating like Sum/Product
Sum (and non-existant Product)
Not implemented. Use reduce, like clojure.core
TODO: time-based operations
Delay
Interval
TimeInterval
Timestamp
Timeout
TODO: handling-exceptions
Throw
Catch
Finally
Retry
OnErrorResumeNext
Do
renamed to each
TODO: cancel-able via close?
Run
TODO: What is this?
Remotable
TODO: What is this?
Take, TakeWhile
Easy peasy!
Drop, DropWhile
Almost as easy as Take & TakeWhile
Used a "transfer" helper
Select
Renamed to map
variadic, so as to handle Zip too
The variadic required some heavy thinking, but wasn't too hard overall
Never, Empty
I think that these are both just (chan)
Return
this is the arity=1 case of emi
Misc functions
emit
Helper function to produce a channel with given items on it
transfer
Copies from one channel to annother
TODO: Fan out operations!
Rx gets this "for free" from multiple subscribers