chaps-io / gush

Fast and distributed workflow runner using ActiveJob and Redis
MIT License
1.04k stars 104 forks source link

params cast to symbol #44

Closed matti closed 2 years ago

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

--> project_id becomes a symbol, why?

pokonski commented 6 years ago

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

pokonski commented 6 years ago

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

matti commented 6 years ago

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.

matti commented 6 years ago

https://github.com/chaps-io/gush/blob/master/lib/gush/client.rb#L130

principle of most surprise.

pokonski commented 6 years ago

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

matti commented 6 years ago

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

pokonski commented 6 years ago

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

pokonski commented 2 years ago

Closing due to inactivity