Skip to content

Exq middleware to atomize job arguments after job deserialization.

Notifications You must be signed in to change notification settings

pixelunion/exq-atomize-job-arguments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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, the package can be installed by adding exq_atomize_job_arguments to your list of dependencies in mix.exs:

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):

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.

About

Exq middleware to atomize job arguments after job deserialization.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages