I tried passing an small object to sidekiq
, but it converts it to a hash. This object is a tracking object for mixpanel. I also tried accessing session variables in my Worker
but they aren't available there either.
Thoughts?
Controller
MixpanelWorker.perform_async(@mixpanel, 'person', mixpanel_distinct_id, cleaned_params)
MixpanelWorker
def perform(mixpanel_object, type_of_send, distinct_id, event)
case type_of_send
when 'person'
mixpanel_object.people.set(distinct_id, event)
when 'event'
mixpanel_object.track(distinct_id, event)
end
end
Worker
. Is that fine to do?