Markdown table:
| single items | mulitple items | |
|---|---|---|
| synchronous | T getData() |
Iterable<T> getData() |
| asynchronous | Future<T> getData() |
Observable<T> getData() |
HTML table:
| Observables fill the gap by being the ideal implementation of access to asynchronous sequences of multiple items | ||
| single items | multiple items | |
|---|---|---|
| synchronous | T getData() |
Iterable<T> getData() |
| asynchronous | Future<T> getData() |
Observable<T> getData() |
| Example code showing how similar high-order functions can be applied to an Iterable and an Observable | |
| Iterable | Observable |
|---|---|
|
|
Code snippet:
def print_hi(name)
puts "Hi, #{name}"
end
print_hi('Tom')
#=> prints 'Hi, Tom' to STDOUT.