I have my Application Controller called McController which extends ApplicationController, and i set a class variable in McController called @@scheduler_map like below:
class McController < ApplicationController
@@scheduler_map = {}
def action
...
end
private
def get_scheduler(host, port)
scheduler = @@scheduler_map[host+"_"+port]
unless scheduler
scheduler = Scheduler.create(host, port)
@@scheduler_map[host+"_"+port] = scheduler
end
scheduler
end
end
but i found that from second request start on @@scheduler_map is always an empty hash, i run it in development env, could someone know the reason? is that related to the running env?
Thank you in advance.