Skip to content
This repository has been archived by the owner on Sep 16, 2020. It is now read-only.

Minor quibble with Readme #7

Open
benwilson512 opened this issue Dec 7, 2015 · 1 comment
Open

Minor quibble with Readme #7

benwilson512 opened this issue Dec 7, 2015 · 1 comment

Comments

@benwilson512
Copy link

Hey!

Looks like a cool library. As a minor quibble though about your readme example, you have

  def perform(to: to, subject: subject, body: body) do
    # do work
  end

It is generally considered to not be a good idea to pattern match on keyword lists as they're order dependent.

While Toniq.enqueue(SendEmailWorker, to: "info@example.com", subject: "Hello", body: "Hello, there!") would work Toniq.enqueue(SendEmailWorker, subject: "Hello", to: "info@example.com", body: "Hello, there!") would not, and that's generally confusing.

Am I correct in reading that perform takes just one argument?

@joakimk
Copy link
Owner

joakimk commented Dec 9, 2015

Yeah, I've noticed that problem and the readme could certainly be improved. Contributions welcome :)

We could maybe update the examples use use maps?

The enqueue takes a list of arguments, and because of that perform does too. So you can probably pass in just about anything there (as long as it can be serialized, so no Pids, etc).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants