aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kill.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/kill.go b/kill.go
index 2d2022b..81ab8ad 100644
--- a/kill.go
+++ b/kill.go
@@ -7,12 +7,6 @@ type Killable interface {
Dead() <-chan bool
}
-type attachable interface {
- Killable
- // Sending to detach() will detach the object from the killer it is attached to.
- detach() <-chan bool
-}
-
// A killer can kill the `victim' that is attached to it.
// The victim can attach itself to the killer by sending itself via the killer's attach() channel.
// The victim can detach itself by sending a signal via its own detach() channel.
@@ -23,6 +17,12 @@ type killer interface {
attach() chan<- attachable
}
+type attachable interface {
+ Killable
+ // Sending to detach() will detach the object from the killer it is attached to.
+ detach() <-chan bool
+}
+
// attachHandler implements killer. It allows victims to attach themselves via the attach channel.
// There can only be one attached victim at a time.
// If attachHandler is killed while a victim is attached, it kills the victim.