question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Client interfaces

See original GitHub issue

I’m wondering if it could make sense to enhance client interface with convenient methods i.e:

  • Options should not be mandatory:
ListenableFuture<PutResponse> put(ByteString key, ByteString value);
  • Leverage java 8 functional interfaces (if project will be moved to java 8 of course):
void put(
   ByteString key, ByteString value, 
   PutOption option, 
   Consumer<PutResponse> onResponse, Consumer<Throwable> onError);

void put(
   ByteString key, ByteString value, 
   Consumer<PutResponse> onResponse, Consumer<Throwable> onError);

void put(
   ByteString key, ByteString value, 
   Consumer<PutResponse> onResponse); throws an RuntimeException in case of error

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jurmouscommented, Jul 22, 2016

My preference would be to return java 8 CompletableFuture on any of those put calls. It seems to be the route for futures/listeners in java going forward. You would then be able to do this:

future.handle((ok, ex) -> {
    if (ok != null) {
        // handle ok
    } else {
        // handle exception
    }
});

or just future.get() for sync call and throws ExecutionException

More: http://www.nurkiewicz.com/2013/05/java-8-definitive-guide-to.html http://download.java.net/lambda/b88/docs/api/java/util/concurrent/CompletableFuture.html

0reactions
ozacommented, Sep 1, 2016

FYI, as I mentioned here, I think we should avoid exposing ByteString as a part of API generated by protobuf directly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Overview of client interfaces - 21744 - Universal Robots
UR robot can interact with external devices by different types of communication interfaces. ... A Universal Robot can be controlled from remote by ......
Read more >
Client Interface - an overview | ScienceDirect Topics
This interface represents the set of services and parameter lists that the client expects the Hardware Proxy to provide. As an interface, it...
Read more >
Definition of the client interface - Progress Documentation
The Open Client object model, which is the basis of the client interface definition, consists of three types of interface objects that model...
Read more >
Documentation: 15: Part IV. Client Interfaces - PostgreSQL
Part IV. Client Interfaces. This part describes the client programming interfaces distributed with PostgreSQL. Each of these chapters can be read independently.
Read more >
Client interface
The client interface API section defines the functions that client applications can use to connect to mm-sync, start and monitor synchronizations, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found