Skip to content

Commit 00487c4

Browse files
tidy up otp code
1 parent 9b4acc4 commit 00487c4

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/barnacle.gleam

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,20 +196,21 @@ type State(error) {
196196
)
197197
}
198198

199-
pub fn start(
200-
barnacle: Barnacle(error),
201-
parent: Option(Subject(Subject(Message(error)))),
202-
) {
199+
pub fn start(barnacle: Barnacle(error)) {
203200
barnacle
204-
|> spec(parent)
201+
|> spec(None)
205202
|> actor.start_spec
206203
}
207204

208205
pub fn child_spec(
209206
barnacle: Barnacle(error),
210-
parent: Option(Subject(Subject(Message(error)))),
207+
parent: Subject(Subject(Message(error))),
211208
) {
212-
supervisor.worker(fn(_) { start(barnacle, parent) })
209+
supervisor.worker(fn(_) {
210+
barnacle
211+
|> spec(Some(parent))
212+
|> actor.start_spec
213+
})
213214
}
214215

215216
pub fn refresh(

0 commit comments

Comments
 (0)