diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2024-08-22 21:05:40 -0400 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2024-08-22 21:05:40 -0400 |
| commit | 59cf78dbab8549761207b706f9856898cb5cd9c2 (patch) | |
| tree | b734052040af3721ed073796edb4af9fcf3a02a4 | |
| parent | f3f79a425119f6e8dd161645447f668d25cd9626 (diff) | |
| download | gui-59cf78dbab8549761207b706f9856898cb5cd9c2.zip | |
kill: reorder interface declarations
| -rw-r--r-- | kill.go | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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. |