Closed adrienmo closed 8 years ago
Good catch, well done! But please check my comment before I can merge it
pool_conf has not been accidentally removed, it is passed directly as init parameter of the worker
you can see the variable pool_conf being passed instead of simply the name :
Indeed, if the configuration is dynamic, there is no global variable to read it from ! The only call to the pool global config is made in the APNS module
Yes, I see now, sorry for my inadvertence. Thank you, I'll merge it. New release is on the way.
Thank you !
Maybe the documentation should be updated with the following code example:
[
{:Certificate, certder, :not_encrypted},
{key_type, keyder, :not_encrypted}
] = :public_key.pem_decode(cert)
pool_conf = [
env: :prod,
pool_size: 10,
pool_max_overflow: 5,
cert: certder,
key: {key_type, keyder}
]
APNS.connect_pool(:pool_name, pool_conf)
rationale :
APNs configurations are not available when starting the elixir project, but are instead saved in a database (e.g. MySQL). We want to be able to dynamically create a connections when the configurations become available. Furthermore we can add a new application configuration on the fly.
solution :