{"id":13564310,"url":"https://github.com/opt-elixir/faktory_worker","last_synced_at":"2025-04-04T13:11:57.743Z","repository":{"id":39007243,"uuid":"175173273","full_name":"opt-elixir/faktory_worker","owner":"opt-elixir","description":"Elixir Faktory worker https://hexdocs.pm/faktory_worker","archived":false,"fork":false,"pushed_at":"2025-03-01T21:07:10.000Z","size":498,"stargazers_count":39,"open_issues_count":4,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T12:08:54.906Z","etag":null,"topics":["elixir","faktory","faktory-worker"],"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/opt-elixir.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2019-03-12T09:04:21.000Z","updated_at":"2025-02-18T15:45:42.000Z","dependencies_parsed_at":"2024-05-01T17:21:10.178Z","dependency_job_id":"223b594e-4c28-4230-a354-5f6e096601f2","html_url":"https://github.com/opt-elixir/faktory_worker","commit_stats":{"total_commits":235,"total_committers":18,"mean_commits":"13.055555555555555","dds":0.6382978723404256,"last_synced_commit":"92ab76d2d2a1ce3f4749aa21120583c78884a914"},"previous_names":["seatedinc/faktory_worker"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opt-elixir%2Ffaktory_worker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opt-elixir%2Ffaktory_worker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opt-elixir%2Ffaktory_worker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opt-elixir%2Ffaktory_worker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opt-elixir","download_url":"https://codeload.github.com/opt-elixir/faktory_worker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247182401,"owners_count":20897381,"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":["elixir","faktory","faktory-worker"],"created_at":"2024-08-01T13:01:29.544Z","updated_at":"2025-04-04T13:11:57.719Z","avatar_url":"https://github.com/opt-elixir.png","language":"Elixir","funding_links":[],"categories":["Queue"],"sub_categories":[],"readme":"# Faktory Worker\n\nA worker client for [Faktory](https://github.com/contribsys/faktory).\n\n## Documentation\n\nFaktory Worker documentation is available at [https://hexdocs.pm/faktory_worker](https://hexdocs.pm/faktory_worker).\n\n## Getting up and running\n\nTo get started with Faktory Worker first add the dependency to your `mix.exs` file.\n\n```elixir\ndefp deps do\n  [\n    {:faktory_worker, \"~\u003e 1.9.8\"}\n  ]\nend\n```\n\nFaktory Worker can then be configured to start as part of your application by adding it to the `Application.start/2` function.\n\n```elixir\ndefmodule MyApp.Application do\n  use Application\n\n  def start(_, _) do\n    children = [\n      FaktoryWorker\n    ]\n\n    Supervisor.start_link(children,\n      strategy: :one_for_one,\n      name: MyApp.Supervisor\n    )\n  end\nend\n```\n\nMake sure you have configured your application to start in your `mix.exs` file.\n\n```elixir\ndef application do\n  [\n    mod: {MyApp.Application, []}\n  ]\nend\n```\n\nThis will start Faktory Worker using the default configuration. For details on how to configure Faktory Worker\nsee the [FaktoryWorker](https://hexdocs.pm/faktory_worker/faktory-worker.html#content) documentation.\n\nNext you can create a worker to handle job processing.\n\n```elixir\ndefmodule MyApp.SomeWorker do\n  use FaktoryWorker.Job\n\n  def perform(job_data) do\n    do_some_work(job_data)\n  end\nend\n```\n\nNow you can start sending jobs to faktory and they will be automatically picked up by the worker.\n\n```elixir\n:ok = MyApp.SomeWorker.perform_async(\"hey there!\")\n```\n#### Important! Since version 1.6.1 Broadway was removed from dependencies and response from perfomr_async is tuple {:ok, job_meta} with meta information about scheduled job.\n```elixir\n{:ok, job_meta} = MyApp.SomeWorker.perform_async(\"hey there!\")\n```\n\n## Sending multiple job arguments\n\nIt's possible to send more than one argument to Faktory by passing a list of data to `perform_async/1`. Picking up from the example in the [Getting up and running](#getting-up-and-running) section we can modify our worker by adding another `perform` function with an arity that matches the number of job arguments we expect to send to Faktory.\n\n```elixir\ndefmodule MyApp.SomeWorker do\n  use FaktoryWorker.Job\n\n  ...\n\n  def perform(arg1, arg2) do\n    do_some_work(arg1, arg2)\n  end\nend\n```\n\nWith this new function in place you can now send multiple job arguments to Faktory.\n\n```elixir\n:ok = MyApp.SomeWorker.perform_async([\"arg 1\", \"arg 2\"])\n```\n\n## Configuration\n\nThe full list of configuration options are available in the [Configuration](https://hexdocs.pm/faktory_worker/configuration.html#content) documentation.\n\n## Logging\n\nBy default Faktory Worker will not output any log messages but instead emit events using the [Telemetry](https://github.com/beam-telemetry/telemetry) library.\n\nTo enable the built in logging you will need to attach the default Telemetry handler provided by FaktoryWorker. The ideal place to do this is in your `Application.start/2` callback.\n\n```elixir\ndefmodule MyApp.Application do\n  use Application\n\n  def start(_, _) do\n    FaktoryWorker.attach_default_telemetry_handler()\n\n    ...\n  end\nend\n```\n\nWith this in place Faktory Worker will now output log messages for each of the events emitted.\n\nFor a full list of Faktory Worker events or for details on handling these events see the [Logging](https://hexdocs.pm/faktory_worker/logging.html#content) documentation.\n\n## Contributing\n\nWe always appreciate contributions whether they are testing, reporting issues, feedback or submitting PRs. If you would like to work on Faktory Worker please follow the [Developing](#developing) section for details on how to get setup for developing and running the test suite.\n\n## Developing\n\nFaktory Worker includes a docker compose file that provisions all of the Faktory instances required to run the test suite.\n\nIf you have docker compose installed you can run the `up` command from the Faktory Worker directory to start everything required.\n\n```sh\n$ docker compose up -d\nCreating faktory_worker_test          ... done\nCreating faktory_worker_test_tls      ... done\nCreating faktory_worker_password_test ... done\n```\n\n\nFaktory have free open-source solution and enterprise edition.\n\nIf you don't have enterprise license then tests will fail on enterprise features (batching operations etc). In this case you can exclude them by tag `:enterprise`\n```sh\nmix test --exclude enterprise\n```\n\nIf you are enterprise user all tests should pass\n```sh\nmix test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopt-elixir%2Ffaktory_worker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopt-elixir%2Ffaktory_worker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopt-elixir%2Ffaktory_worker/lists"}