Skip to content

Commit

Permalink
trap exits and do not link subject on creation
Browse files Browse the repository at this point in the history
  • Loading branch information
m1dnight committed Mar 15, 2021
1 parent 683c13a commit 5d36566
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/behavior/gen_observable.ex
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ defmodule Observables.GenObservable do
by the programmer.
"""
def init({mod, args}) do
Process.flag :trap_exit, true
case mod.init(args) do
{:ok, state} ->
# Initial state of Observable
Expand Down
2 changes: 1 addition & 1 deletion lib/subject.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defmodule Observables.Subject do
"""

def create() do
{:ok, pid} = GenObservable.spawn_supervised(Observables.Operator.Subject)
{:ok, pid} = GenObservable.start(Observables.Operator.Subject, [])

pid
end
Expand Down

0 comments on commit 5d36566

Please sign in to comment.