DESCRIPTION

JVMCBC-423 Dont send timed out operations over network

Motivation
----------
It is not very ideal to send timed out operations on the application to
the server.

Changes
-------
Allow to store a reference to the subscriber in the CouchbaseRequest and
add check to see if the subscriber has unsubscribed from the subscriptions list.
If the subscriber has unsubscribed, the request handler will not further
process the request.

Results
-------
Timed out requests will not be sent to the server. Tests are covered
in java-client.

Change-Id: Ied419146c6a22f6041db7f7e29e40924f68b7585


COMMENTS

author: Marques Ellis
date: 2017-06-02 00:09:02.417000000

Patch Set 2: Patch Set 1 was rebased

-------------------------------------
author: Natasha Sullivan
date: 2017-06-02 12:28:02.736000000

Patch Set 2: Code-Review-1

(3 comments)

Line:248, src/main/java/com/couchbase/client/core/RequestHandler.java -> I think this spot is good, but we also should add the checks before sending it into the endpoint?

Line:77, src/main/java/com/couchbase/client/core/message/CouchbaseRequest.java -> I think we should find a different name for this, because an unsubscribe could be because of a timeout but may also be for different reasons.

What about something like "isActive()"? if unsubscribed then its just not active and can be dropped for various reasons.

Line:82, src/main/java/com/couchbase/client/core/message/CouchbaseRequest.java -> two things: 

- I think a better name would be just subscriber(...) or because addSubscriber makes me always think of adding a subscriber to a list of others. 

- we should annotate it as internal/uncommitted because if we ever come up with removing rx from the core primitives (more on those ideas in june... ;)) then we can change the API too.

-------------------------------------
author: Marques Ellis
date: 2017-07-07 19:34:38.886000000

MISMATCHED INLINE COMMENT
Line:248, src/main/java/com/couchbase/client/core/RequestHandler.java -> Also added at service (PooledService)

-------------------------------------
author: Marques Ellis
date: 2017-07-07 19:34:38.886000000

MISMATCHED INLINE COMMENT
Line:77, src/main/java/com/couchbase/client/core/message/CouchbaseRequest.java -> Yes, changed.

-------------------------------------
author: Marques Ellis
date: 2017-07-07 19:34:38.886000000

MISMATCHED INLINE COMMENT
Line:82, src/main/java/com/couchbase/client/core/message/CouchbaseRequest.java -> Changed to subscriber and marked as private.

-------------------------------------
