I write some example on erlang and mongodb. As driver for mongodb I use emongo. Problem is if I make connection in one module I can not reuse this connection in different modules. In C/C++ or other objective languages I can make singleton and use it. How can I reuse open connection in erlang?
Thanks.
I write some example on erlang and mongodb. As driver for mongodb I use
Share
You should be able to re-use the pool ID from any part of your application.
In module A:
In module B:
As long as you keep using the same id (in this case,
test) either by hard coding it into the different modules or by sending it in a message, you should be able to use the library from any part of the application.