From 3d600e4ba8bf2507be28e2238d0b5bd46faa0451 Mon Sep 17 00:00:00 2001 From: Jason Stiebs Date: Thu, 22 Aug 2024 10:20:46 -0500 Subject: [PATCH 1/2] Update readme and deps to reduce warnings. --- README.md | 19 +++++++++++++------ mix.exs | 2 +- mix.lock | 7 ++++--- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 67f4330..985667c 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,17 @@ +# Flame + +[![Hex.pm version](https://img.shields.io/hexpm/v/flame.svg)](https://hex.pm/packages/flame) +[![Hex.pm downloads](https://img.shields.io/hexpm/dt/flame.svg)](https://hex.pm/packages/flame) +[![Hex.pm weekly downloads](https://img.shields.io/hexpm/dw/flame.svg)](https://hex.pm/packages/flame) +[![Hex.pm daily downloads](https://img.shields.io/hexpm/dd/flame.svg)](https://hex.pm/packages/flame) + Imagine if we could auto scale simply by wrapping any existing app code in a function and have that block of code run in a temporary copy of the app. Enter the FLAME pattern. > FLAME - Fleeting Lambda Application for Modular Execution -With FLAME, you treat your *entire application* as a lambda, where modular parts can be executed on short-lived infrastructure. +With FLAME, you treat your _entire application_ as a lambda, where modular parts can be executed on short-lived infrastructure. Check the screencast to see it in action: @@ -19,7 +26,7 @@ defp deps do [ # For Erlang/OTP 26 and earlier, you also need Jason # {:jason, ">= 0.0.0"}, - {:flame, "~> 0.2"} + {:flame, "~> 0.3"} ] end ``` @@ -54,12 +61,12 @@ def generate_thumbnails(%Video{} = vid, interval) do end ``` -Here we wrapped up our CPU expensive `ffmpeg` operation in a `FLAME.call/2`. FLAME accepts a function and any variables that the function closes over. In this example, the `%Video{}` struct and `interval` are passed along automatically. The work happens in a temporary copy of the app. We can do any work inside the FLAME call because we are running the *entire application*, database connection(s) and all. +Here we wrapped up our CPU expensive `ffmpeg` operation in a `FLAME.call/2`. FLAME accepts a function and any variables that the function closes over. In this example, the `%Video{}` struct and `interval` are passed along automatically. The work happens in a temporary copy of the app. We can do any work inside the FLAME call because we are running the _entire application_, database connection(s) and all. `FLAME` provides the following interfaces for elastically scaled operations: - * `FLAME.call/3` - used for synchronous calls - * `FLAME.cast/3` - used for async casts where you don't need to wait on the results - * `FLAME.place_child/3` – used for placing a child spec somewhere to run, in place of `DynamicSupervisor.start_child`, `Task.Supervisor.start_child`, etc +- `FLAME.call/3` - used for synchronous calls +- `FLAME.cast/3` - used for async casts where you don't need to wait on the results +- `FLAME.place_child/3` – used for placing a child spec somewhere to run, in place of `DynamicSupervisor.start_child`, `Task.Supervisor.start_child`, etc The `FLAME.Pool` handles elastically scaling runners up and down, as well as remote monitoring of resources. Check the moduledoc for example usage. diff --git a/mix.exs b/mix.exs index 0dd866a..9499d34 100644 --- a/mix.exs +++ b/mix.exs @@ -45,7 +45,7 @@ defmodule FLAME.Runner.MixProject do [ {:jason, ">= 0.0.0", optional: true}, {:castore, ">= 0.0.0", optional: true}, - {:mox, "~> 1.1.0", only: :test}, + {:mox, "~> 1.2.0", only: :test}, {:ex_doc, ">= 0.0.0", only: :dev, runtime: false} ] end diff --git a/mix.lock b/mix.lock index e104bd7..6e6a63d 100644 --- a/mix.lock +++ b/mix.lock @@ -1,11 +1,12 @@ %{ - "castore": {:hex, :castore, "1.0.7", "b651241514e5f6956028147fe6637f7ac13802537e895a724f90bf3e36ddd1dd", [:mix], [], "hexpm", "da7785a4b0d2a021cd1292a60875a784b6caef71e76bf4917bdee1f390455cf5"}, + "castore": {:hex, :castore, "1.0.8", "dedcf20ea746694647f883590b82d9e96014057aff1d44d03ec90f36a5c0dc6e", [:mix], [], "hexpm", "0b2b66d2ee742cb1d9cb8c8be3b43c3a70ee8651f37b75a8b982e036752983f1"}, "earmark_parser": {:hex, :earmark_parser, "1.4.41", "ab34711c9dc6212dda44fcd20ecb87ac3f3fce6f0ca2f28d4a00e4154f8cd599", [:mix], [], "hexpm", "a81a04c7e34b6617c2792e291b5a2e57ab316365c2644ddc553bb9ed863ebefa"}, "ex_doc": {:hex, :ex_doc, "0.34.2", "13eedf3844ccdce25cfd837b99bea9ad92c4e511233199440488d217c92571e8", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "5ce5f16b41208a50106afed3de6a2ed34f4acfd65715b82a0b84b49d995f95c1"}, - "jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"}, + "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, "makeup": {:hex, :makeup, "1.1.2", "9ba8837913bdf757787e71c1581c21f9d2455f4dd04cfca785c70bbfff1a76a3", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cce1566b81fbcbd21eca8ffe808f33b221f9eee2cbc7a1706fc3da9ff18e6cac"}, "makeup_elixir": {:hex, :makeup_elixir, "0.16.2", "627e84b8e8bf22e60a2579dad15067c755531fea049ae26ef1020cad58fe9578", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "41193978704763f6bbe6cc2758b84909e62984c7752b3784bd3c218bb341706b"}, "makeup_erlang": {:hex, :makeup_erlang, "1.0.1", "c7f58c120b2b5aa5fd80d540a89fdf866ed42f1f3994e4fe189abebeab610839", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "8a89a1eeccc2d798d6ea15496a6e4870b75e014d1af514b1b71fa33134f57814"}, - "mox": {:hex, :mox, "1.1.0", "0f5e399649ce9ab7602f72e718305c0f9cdc351190f72844599545e4996af73c", [:mix], [], "hexpm", "d44474c50be02d5b72131070281a5d3895c0e7a95c780e90bc0cfe712f633a13"}, + "mox": {:hex, :mox, "1.2.0", "a2cd96b4b80a3883e3100a221e8adc1b98e4c3a332a8fc434c39526babafd5b3", [:mix], [{:nimble_ownership, "~> 1.0", [hex: :nimble_ownership, repo: "hexpm", optional: false]}], "hexpm", "c7b92b3cc69ee24a7eeeaf944cd7be22013c52fcb580c1f33f50845ec821089a"}, + "nimble_ownership": {:hex, :nimble_ownership, "1.0.0", "3f87744d42c21b2042a0aa1d48c83c77e6dd9dd357e425a038dd4b49ba8b79a1", [:mix], [], "hexpm", "7c16cc74f4e952464220a73055b557a273e8b1b7ace8489ec9d86e9ad56cb2cc"}, "nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"}, } From 205d0698fcabba9f29727f6dfc4bbd63c2b70d29 Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 22 Aug 2024 10:21:22 -0500 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 985667c..4d2da1d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Flame +# FlAME [![Hex.pm version](https://img.shields.io/hexpm/v/flame.svg)](https://hex.pm/packages/flame) [![Hex.pm downloads](https://img.shields.io/hexpm/dt/flame.svg)](https://hex.pm/packages/flame)