{"id":13513820,"url":"https://github.com/phoenixframework/flame","last_synced_at":"2025-12-11T23:39:10.603Z","repository":{"id":211097337,"uuid":"712045011","full_name":"phoenixframework/flame","owner":"phoenixframework","description":"Fleeting Lambda Application for Modular Execution: auto scale parts of your existing app with a single function call","archived":false,"fork":false,"pushed_at":"2025-11-01T19:52:56.000Z","size":193,"stargazers_count":1120,"open_issues_count":26,"forks_count":56,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-11-01T21:17:54.035Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phoenixframework.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-10-30T17:21:14.000Z","updated_at":"2025-11-01T19:52:59.000Z","dependencies_parsed_at":"2023-12-06T13:39:35.553Z","dependency_job_id":"c57d1a8e-f0f0-430d-a283-42ee765b1a4a","html_url":"https://github.com/phoenixframework/flame","commit_stats":null,"previous_names":["phoenixframework/flame","phoenixframework/dragonfly"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/phoenixframework/flame","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoenixframework%2Fflame","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoenixframework%2Fflame/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoenixframework%2Fflame/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoenixframework%2Fflame/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phoenixframework","download_url":"https://codeload.github.com/phoenixframework/flame/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoenixframework%2Fflame/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27672209,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-11T02:00:11.302Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T05:00:38.249Z","updated_at":"2025-12-11T23:39:10.581Z","avatar_url":"https://github.com/phoenixframework.png","language":"Elixir","funding_links":[],"categories":["Elixir"],"sub_categories":[],"readme":"[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/phoenixframework/flame/elixir.yml)](https://github.com/phoenixframework/flame/actions/workflows/elixir.yml) [![Hex.pm](https://img.shields.io/hexpm/v/flame.svg)](https://hex.pm/packages/flame) [![Documentation](https://img.shields.io/badge/documentation-gray)](https://hexdocs.pm/flame)\n\nImagine 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.\n\nEnter the FLAME pattern.\n\n\u003e FLAME - Fleeting Lambda Application for Modular Execution\n\nWith FLAME, you treat your *entire application* as a lambda, where modular parts can be executed on short-lived infrastructure.\n\nCheck the screencast to see it in action:\n\n[![Video](https://img.youtube.com/vi/l1xt_rkWdic/maxresdefault.jpg)](https://www.youtube.com/watch?v=l1xt_rkWdic)\n\n## Setup\n\nFirst add `:flame` as a dependency:\n\n```elixir\ndefp deps do\n  [\n    # For Erlang/OTP 26 and earlier, you also need Jason\n    # {:jason, \"\u003e= 0.0.0\"},\n    {:flame, \"~\u003e 0.5\"}\n  ]\nend\n```\n\nThen start a FLAME pool in your supervision tree, typically on `application.ex`. The example below uses [Fly.io](https://fly.io/)'s backend:\n\n```elixir\nchildren = [\n  {FLAME.Pool,\n   name: MyApp.SamplePool,\n   backend: FLAME.FlyBackend,\n   min: 0,\n   max: 10,\n   max_concurrency: 5,\n   idle_shutdown_after: 30_000,\n   log: :debug}\n]\n```\n\nNow you can wrap any block of code in a `FLAME.call` and it will find or boot a copy of the app, execute the work there, and return the results:\n\n```elixir\ndef generate_thumbnails(%Video{} = vid, interval) do\n  FLAME.call(MyApp.FFMpegRunner, fn -\u003e\n    # I'm runner on a short-lived, temporary server\n    tmp_dir = Path.join(System.tmp_dir!(), Ecto.UUID.generate())\n    File.mkdir!(tmp_dir)\n    System.cmd(\"ffmpeg\", ~w(-i #{vid.url} -vf fps=1/#{interval} #{tmp_dir}/%02d.png))\n    urls = VideoStore.put_thumbnails(vid, Path.wildcard(tmp_dir \u003c\u003e \"/*.png\"))\n    Repo.insert_all(Thumbnail, Enum.map(urls, \u0026%{video_id: vid.id, url: \u00261}))\n  end)\nend\n```\n\nHere 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.\n\n`FLAME` provides the following interfaces for elastically scaled operations:\n\n  * `FLAME.call/3` - used for synchronous calls\n  * `FLAME.cast/3` - used for async casts where you don't need to wait on the results\n  * `FLAME.place_child/3` – used for placing a child spec somewhere to run, in place of `DynamicSupervisor.start_child`, `Task.Supervisor.start_child`, etc\n\nThe `FLAME.Pool` handles elastically scaling runners up and down, as well as remote monitoring of resources. Check the moduledoc for example usage.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphoenixframework%2Fflame","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphoenixframework%2Fflame","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphoenixframework%2Fflame/lists"}