monix / shade

Memcached client for Scala
MIT License
106 stars 19 forks source link

Accessing underlying `TimedOutOperationStatus` #57

Open lloydmeta opened 7 years ago

lloydmeta commented 7 years ago

Currently there are 2 ways to get a TimedOutStatus from Shade:

  1. Timeout from the scheduler: https://github.com/monix/shade/blob/4fc59759d33d54fe500d6131a492f57b9ed29575/src/main/scala/shade/memcached/internals/SpyMemcachedIntegration.scala#L387

  2. Timeout from the Spymemcached layer translated into a TimedOutStatus https://github.com/monix/shade/blob/4fc59759d33d54fe500d6131a492f57b9ed29575/src/main/scala/shade/memcached/internals/SpyMemcachedIntegration.scala#L427-L428

For the purposes of debugging, it would be nice to be able to distinguish between the two.

How

I think one way to do this is by turning the existing case object TimedOutStatus into a final case class TimedOutStatus(underlying: Option[TimedOutOperationStatus]).

The other way to do this might be to introduce a whole knew case object for either one of the aforementioned cases.