Can we borrow the design of The Netty Project, say returning a 
`org.apache.dubbo.filter.Future` that is declared like below:

```java
class Future<T> {
  T get(); // wait for the result synchronously
  void onComplete(SomeContext c); // asynchronously
  void onSend(SomeContext c); // asynchronously
  void onError(SomeContext c); // asynchronously
  // ... other callbacks
}
```

then users can do something like this:
```java
Filter filter = ...;
Future f = filter.invoke(...);
// if synchronous call is needed
f.get();
// if asynchronous call is needed
f.onSend(context -> { /* lambda */ });
f.onError(context -> { /* lambda */ });
// ... others
```

[ Full content available at: 
https://github.com/apache/incubator-dubbo/issues/3585 ]
This message was relayed via gitbox.apache.org for 
[email protected]

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to