awesome1990
How to use Quantum?
Am new to Elixir and i need help how to schedule a task…
defmodule PluralsightTweet.Scheduler do
def schedule_file(schedule, file) do
Quantum.add_job(schedule, fn -> IO.puts PluralsightTweet.FileReader.get_strings_to_tweet(file) end)
end
end
this is the error am getting:
Quantum.add_job(“* * * * * * “, fn-> IO.puts “test” end)
** (UndefinedFunctionError) function Quantum.add_job/2 is undefined or private
(quantum) Quantum.add_job(” * * * * * *”, function<20.99386804/0 in :erl_eval.expr/5>)
Most Liked
kelvinst
That’s not how you must use Quantum, follow their documentation on: https://hexdocs.pm/quantum/readme.htm
More details:
Quantum.add_job/2is not a function, maybe what you mean isQuantum.Scheduler.add_job/2Quantum.Scheduler.add_job/2is not a function also, and yes a callback that should be defined by the modules that use@behaviour Quantum.Scheduler
My impression is that you may be confusing what the lib quantum really is. It’s not a job scheduler like, for example, sidekiq, what it does is something like what the command line tool cron does, scheduling recurrent executions.
1
Last Post!
kelvinst
Popular in Questions
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set?
Thanks.
New
Hey all,
I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
Other popular topics
Hello!
Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something…
Haskell reminds me of Java, and e...
New
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









