From ab026af52606ea49de62a1547094b379658d5bd1 Mon Sep 17 00:00:00 2001 From: Barna Kovacs Date: Tue, 27 Aug 2024 23:25:32 +0200 Subject: [PATCH] Fix typos and improve language (#52) --- lib/flame.ex | 10 +++++----- lib/flame/fly_backend.ex | 4 ++-- lib/flame/local_backend.ex | 2 +- lib/flame/parent.ex | 2 +- lib/flame/pool.ex | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/flame.ex b/lib/flame.ex index 9341271..de50b87 100644 --- a/lib/flame.ex +++ b/lib/flame.ex @@ -21,8 +21,8 @@ defmodule FLAME do web requests, etc, to come to crawl. This is where folks typically reach for FaaS or external service solutions, but FLAME gives you a better way. - Simply wrap your your existing code in a FLAME function and it will be executed - on a newly spawned, ephemeral node. Using Elixir and Erlang's built in distribution + Simply wrap your existing code in a FLAME function and it will be executed + on a newly spawned, ephemeral node. Using Elixir and Erlang's built-in distribution features, entire function closures, including any state they close over, can be sent and executed on a remote node: @@ -49,7 +49,7 @@ defmodule FLAME do ## Pools A `FLAME.Pool` provides elastic runner scaling, allowing a minimum and - maximum number of runners to be configured, and idle'd down as load decreases. + maximum number of runners to be configured, and idled down as load decreases. Pools give you elastic scale that maximizes the newly spawned hardware. At the same time, you also want to avoid spawning unbound resources. You also @@ -68,10 +68,10 @@ defmodule FLAME do ] Here we add a `FLAME.Pool` to our application supervision tree, configuring - a minimum of 0 and maximum of 10 runners. This acheives "scale to zero" behavior + a minimum of 0 and maximum of 10 runners. This achieves "scale to zero" behavior while also allowing the pool to scale up to 10 runners when load increases. Each runner in the case will be able to execute up to 5 concurrent functions. - The runners will shutdown after 30 seconds of inactivity. + The runners will shut down after 30 seconds of inactivity. Calling a pool is as simple as passing its name to the FLAME functions: diff --git a/lib/flame/fly_backend.ex b/lib/flame/fly_backend.ex index eb6e517..55da797 100644 --- a/lib/flame/fly_backend.ex +++ b/lib/flame/fly_backend.ex @@ -51,7 +51,7 @@ defmodule FLAME.FlyBackend do * `:entrypoint` – list strings for the entrypoint command * `:exec` – list of strings for the exec command * `:kernel_args` - list of strings - * `:swap_size_mb` – integer value in megabytes for th swap size + * `:swap_size_mb` – integer value in megabytes for the swap size * `:tty` – boolean * `:services` - The optional services to run on the machine. Defaults to `[]`. @@ -60,7 +60,7 @@ defmodule FLAME.FlyBackend do ## Environment Variables - The FLAME Fly machines do *do not* inherit the environment variables of the parent. + The FLAME Fly machines *do not* inherit the environment variables of the parent. You must explicit provide the environment that you would like to forward to the machine. For example, if your FLAME's are starting your Ecto repos, you can copy the env from the parent: diff --git a/lib/flame/local_backend.ex b/lib/flame/local_backend.ex index 5868121..aa44fef 100644 --- a/lib/flame/local_backend.ex +++ b/lib/flame/local_backend.ex @@ -31,7 +31,7 @@ defmodule FLAME.LocalBackend do other -> raise ArgumentError, - "expected a null arity function or {mod, func, args. Got: #{inspect(other)}" + "expected a null arity function or {mod, func, args}. Got: #{inspect(other)}" end end diff --git a/lib/flame/parent.ex b/lib/flame/parent.ex index e3a76df..6775f89 100644 --- a/lib/flame/parent.ex +++ b/lib/flame/parent.ex @@ -16,7 +16,7 @@ defmodule FLAME.Parent do * `:backend_vsn` - The FLAME backend version running on the parent. * `:node_base` - The node basename the parent generated for the runner. * `:host_env` - The environment variable name on the runner to use to - to lookup the runner's hostname for the runner's longname. + lookup the runner's hostname for the runner's longname. """ @flame_vsn Keyword.fetch!(Mix.Project.config(), :version) diff --git a/lib/flame/pool.ex b/lib/flame/pool.ex index e602e2f..345b8c7 100644 --- a/lib/flame/pool.ex +++ b/lib/flame/pool.ex @@ -123,7 +123,7 @@ defmodule FLAME.Pool do * `:count` - The number of runners the pool is attempting to grow to * `:pid` - The pid of the async process that is booting the new runner - * `:on_grow_end` - The optional 2-arty function to be called when the pool growth process completes. + * `:on_grow_end` - The optional 2-arity function to be called when the pool growth process completes. The 2-arity function receives either `:ok` or `{:exit, reason}`, and map with the following metadata: * `:name` - The name of the pool @@ -158,7 +158,7 @@ defmodule FLAME.Pool do only the specific beam files will be synced on boot and for subsequent calls. Defaults to `[]`. - * `:start_apps` – Either a boolean or a list of specific OTP applications names to start + * `:start_apps` – Either a boolean or a list of specific OTP application names to start when the runner boots. When `true`, all applications currently running on the parent node are sent to the runner node to be started. Defaults to `false`.