{"id":16732546,"url":"https://github.com/antonmi/start-flowex","last_synced_at":"2025-03-15T19:44:03.283Z","repository":{"id":145877490,"uuid":"84460826","full_name":"antonmi/Start-Flowex","owner":"antonmi","description":"Examples how to start Flowex pipelines","archived":false,"fork":false,"pushed_at":"2017-03-09T17:13:10.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-22T08:47:11.285Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antonmi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2017-03-09T15:58:13.000Z","updated_at":"2017-03-09T15:58:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"70f3c6b5-2903-4b96-9c69-1bfdf13f0da5","html_url":"https://github.com/antonmi/Start-Flowex","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonmi%2FStart-Flowex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonmi%2FStart-Flowex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonmi%2FStart-Flowex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonmi%2FStart-Flowex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antonmi","download_url":"https://codeload.github.com/antonmi/Start-Flowex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243784099,"owners_count":20347409,"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","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-10-12T23:45:32.531Z","updated_at":"2025-03-15T19:44:03.260Z","avatar_url":"https://github.com/antonmi.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StartFlowex\n\n### Examples how to start [Flowex](https://github.com/antonmi/flowex) pipelines\n\n###In general there are three options:\n#### 1. Start pipelines in arbitrary supervised process\n```elixir\ndefmodule PipelineGenServer do\n  use GenServer\n\n  def init(_opts) do\n    pipeline_one = PipelineOne.start\n    pipeline_two = PipelineTwo.start\n\n    {:ok, %{pipeline_one: pipeline_one, pipeline_two: pipeline_two}}\n  end\nend\n```\nYou can also store pipeline structure in Agent or Application environment\n\n#### 2. Start one pipeline per application. In that case pipeline supervisor will be the main supervisor in the application:\n```elixir\ndefmodule OnePipelinePerApp do\n  use Application\n\n  def start(_type, _opts) do\n    pipeline = PipelineOne.start\n    Application.put_env(:start_flowex, :pipeline, pipeline)\n    {:ok, pipeline.sup_pid}\n  end\nend\n```\n\n#### 3. Start several pipelines inside one application using `supervised_start` function. In that case pipeline supervisors will be placed under application supervisor:\n```elixir\ndefmodule TwoPipelinesPerApp do\n  use Application\n\n  def start(_type, _opts) do\n    {:ok, supervisor_pid} = Supervisor.start_link([], strategy: :one_for_one, name: :multi_flowex_sup)\n\n    pipeline_one = PipelineOne.supervised_start(supervisor_pid)\n    pipeline_two = PipelineTwo.supervised_start(supervisor_pid)\n\n    Application.put_env(:start_flowex, :pipeline_one, pipeline_one)\n    Application.put_env(:start_flowex, :pipeline_two, pipeline_two)\n\n    {:ok,supervisor_pid}\n  end\nend\n```\n\nYou can play around with different cases by choosing application module in `application` function in `mix.exs` file\n\n```elixir\ndef application do\n  [\n    mod: {InsideSupervisedGenServer, []}\n    # mod: {OnePipelinePerApp, []}\n    # mod: {TwoPipelinesPerApp, []}\n  ]\nend```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonmi%2Fstart-flowex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantonmi%2Fstart-flowex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonmi%2Fstart-flowex/lists"}