def setup_mapper_options(opts, options)
setup_common_options(opts, options, 'mapper')
opts.on("-a", "--agent-timeout TIMEOUT", "How long to wait before an agent is considered to be offline and thus removed from the list of available agents.") do |timeout|
options[:agent_timeout] = timeout
end
opts.on("-r", "--offline-redelivery-frequency", "The frequency in seconds that messages stored in the offline queue will be retrieved for attempted redelivery to the nanites. Default is 10 seconds.") do |frequency|
options[:offline_redelivery_frequency] = frequency
end
opts.on("--persistent", "Instructs the AMQP broker to save messages to persistent storage so that they aren't lost when the broker is restarted. Can be overriden on a per-message basis using the request and push methods.") do
options[:persistent] = true
end
opts.on("--offline-failsafe", "Store messages in an offline queue when all the nanites are offline. Messages will be redelivered when nanites come online. Can be overriden on a per-message basis using the request methods.") do
options[:offline_failsafe] = true
end
opts.on("--redis HOST_PORT", "Use redis as the agent state storage in the mapper: --redis 127.0.0.1:6379; missing host and/or port will be filled with defaults if colon is present") do |redis|
redishost, redisport = redis.split(':')
redishost = '127.0.0.1' if (redishost.nil? || redishost.empty?)
redisport = '6379' if (redishost.nil? || redishost.empty?)
redis = "#{redishost}:#{redisport}"
options[:redis] = redis
end
end