chaps-io/gush

params cast to symbol

matti opened this issue · 8 comments

matti commented
 run MyJob, {
      params: {
        "project_id" => opts["project_id"]
      }

--> project_id becomes a symbol, why?

Because they are serialized to JSON, stored in Redis and deserialized from it when job runs.

Happens here https://github.com/chaps-io/gush/blob/master/lib/gush/client.rb#L130. And why a symbol? Pure preference 😁

matti commented

huh, if you do a similar thing with sidekiq it keeps keys as strings.

also, if you give a symbol as an argument in sidekiq, it becomes a string. so this behaviour is kinda other way around than in sidekiq.

I don't like keys as strings, hence the preference.

matti commented

That preference is really against the most popular (?) implementation of similar tool (sidekiq) - it should be atleast configurable

Yeah, configuration option sounds good. Would you mind preparing a PR?

Closing due to inactivity