InterruptibleEquality

tinyscalautils.lang.InterruptibleEquality

Checks for thread interrupts in equals and hashCode.

This can be used to make code more responsive to interrupts, e.g.:

class MyFancyClass extends SomeInterface with InterruptibleEquality:
 ...

If a thread is interrupted and then attempts to call equals or hashCode, an InterruptedException will be thrown; otherwise, the call is forwarded to the super method.

Note that == and ## rely on equals and hasCode, and thus will also throw the InterruptedException.

Attributes

Since

1.0

Source
InterruptibleEquality.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def equals(obj: Any): Boolean

Checks for interrupts, then forwards call.

Checks for interrupts, then forwards call.

Attributes

Definition Classes
Any
Source
InterruptibleEquality.scala
override def hashCode(): Int

Checks for interrupts, then forwards call.

Checks for interrupts, then forwards call.

Attributes

Definition Classes
Any
Source
InterruptibleEquality.scala