WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit a5b73f0

Browse files
1 parent a24de6a commit a5b73f0

File tree

1 file changed

+15
-21
lines changed

1 file changed

+15
-21
lines changed

lib/split.ex

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,23 @@ defmodule Split do
1010
The most basic approach is to add `Split` as a child of your application's
1111
top-most supervisor, i.e. `lib/my_app/application.ex`.
1212
13-
```elixir
14-
defmodule MyApp.Application do
15-
use Application
16-
17-
def start(_type, _args) do
18-
children = [
19-
# ... other children ...
20-
{Split, [socket_path: "/var/run/split.sock"]}
21-
]
22-
23-
opts = [strategy: :one_for_one, name: MyApp.Supervisor]
24-
Supervisor.start_link(children, opts)
25-
end
26-
end
27-
```
13+
defmodule MyApp.Application do
14+
use Application
15+
16+
def start(_type, _args) do
17+
children = [
18+
# ... other children ...
19+
{Split, [socket_path: "/var/run/split.sock"]}
20+
]
21+
22+
opts = [strategy: :one_for_one, name: MyApp.Supervisor]
23+
Supervisor.start_link(children, opts)
24+
end
25+
end
2826
2927
You can also start `Split` dynamically by calling `Split.Supervisor.start_link/1`:
3028
31-
```elixir
32-
Split.Supervisor.start_link(opts)
33-
```
29+
Split.Supervisor.start_link(opts)
3430
3531
### Options
3632
@@ -45,9 +41,7 @@ defmodule Split do
4541
4642
Once you have started Split, you are ready to start interacting with the Split.io splitd's daemon to access feature flags and configurations.
4743
48-
```elixir
49-
Split.get_treatment("user_key", "feature_name")
50-
```
44+
Split.get_treatment("user_key", "feature_name")
5145
"""
5246
alias Split.Telemetry
5347
alias Split.Sockets.Pool

0 commit comments

Comments
 (0)