Version 3.1.0 adds
- support for storing jobs in MySQL 8, thanks @jeanparpaillon !
- persisting job params as an Elixir/Erlang term, thanks @lukyanov !
You can insert any arbitrary Elixir/Erlang term into the queue:
{"SendEmail", "[email protected]", "Welcome!"}
|> MyApp.JobQueue.new()
|> MyApp.Repo.insert()
You should use the option :params_type when defining your queue module:
defmodule MyJobQueue do
use EctoJob.JobQueue, table_name: "jobs", params_type: :binary
# ...
end
Possible values of the option are: :map (default) and :binary (for storing Elixir/Erlang terms).
You should use the same option when setting up the migration:
@ecto_job_version 3
def up do
EctoJob.Migrations.Install.up()
EctoJob.Migrations.up("jobs", version: @ecto_job_version, params_type: :binary)
end