https://github.com/pixelunion/exq-atomize-job-arguments
Exq middleware to atomize job arguments after job deserialization.
https://github.com/pixelunion/exq-atomize-job-arguments
library
Last synced: over 1 year ago
JSON representation
Exq middleware to atomize job arguments after job deserialization.
- Host: GitHub
- URL: https://github.com/pixelunion/exq-atomize-job-arguments
- Owner: pixelunion
- Created: 2018-06-12T17:25:25.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-07-20T05:14:28.000Z (almost 5 years ago)
- Last Synced: 2024-03-26T12:58:30.139Z (over 2 years ago)
- Topics: library
- Language: Elixir
- Size: 46.9 KB
- Stars: 1
- Watchers: 17
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ExqAtomizeJobArguments
AtomizeJobArguments middleware converts the job arguments to be atoms
instead of strings for types that AtomicMap supports.
The lossy behaviour of atoms being converted to strings on JSON deserialization
is to be expected. Introducing this change directly to exq would cause
backwards compatibility issues.
## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `exq_atomize_job_arguments` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:exq_atomize_job_arguments, "~> 0.1.0"}
]
end
```
After you've defined and fetched the dependency, you can inject the middleware into
by adding the module within the Exq configuration for your environment (or `config.exs`):
```elixir
config :exq,
host: "127.0.0.1",
port: 6379,
middleware: [
Exq.Middleware.Stats,
Exq.Middleware.Job,
Exq.Middleware.Manager,
Exq.Middleware.Logger,
Exq.Middleware.AtomizeJobArguments
]
```
## Documentation
The documentation can be found at [https://hexdocs.pm/exq_atomize_job_arguments](https://hexdocs.pm/exq_atomize_job_arguments).