Introduce support for calls as composable objects
- Dominant language
- Java
- Stars
- 12.1k
- Forks
- 4k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 37
Description
Let's suppose we call it "Callable" (actual name may differ), and it is related to Call as is f.i. Iterable to Iterator, or Observable to Observer in the Rx pattern.
The basic contract would be:
```
class Callable {
abstract Call newCall(Channel ch);
}
```
Basic creation operations for Callable would be:
```
static Callable create(MethodDescriptor method);
static Callable create(BiFunction function);
```
Sequential composition would be supported, as well as various ways to parallelize execution:
```
Callable followedBy(Callable second);
Callable, List> inParallel();
...
```
Building blocks for dealing with API programming patterns would be supported:
```
Callable retrying(RetryOptions options);
Callable paging(Class resourceType, PagingOptions options);
```
Additional scenarios which might be supported by callables or related means:
- Resource modification (Read-Modify-Write cycle), with conditions
- Media upload and download
- Long running operations
- PubSub
- Conversion to/from Rx and to/from Java 8 streams (no need to reinvent the wheel here. If someone wants to do processing of responses or produce requests, those frameworks should have everything)
- ...
Contributor guide
Assessment
This issue has not been assessed yet.