Skip to content

Commit d993ee0

Browse files
craigplpil
authored andcommitted
child_spec for Elixir 1.5 workers/supervisors (honza#965)
* child_spec for Elixir 1.5 workers/supervisors * Extra parans for child_spec opts and args
1 parent d0b6529 commit d993ee0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

snippets/elixir.snippets

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,17 @@ snippet >i pipe to inspect
195195
|> IO.inspect
196196
snippet >il pipe to inspect with label
197197
|> IO.inspect(label: "${1:label}")
198+
snippet cs
199+
@doc false
200+
def child_spec(${1:_opts}) do
201+
%{
202+
id: __MODULE__,
203+
start: {__MODULE__, :start_link, ${2:[]}},
204+
restart: ${3::permanent},
205+
shutdown: ${4:5000},
206+
type: ${5::worker}
207+
}
208+
end
198209
snippet genserver basic genserver structure
199210
use GenServer
200211

0 commit comments

Comments
 (0)