Mongo.Pool.Adapter behaviour

The driver supports multiple pooling strategies as long as they implement the following interface.

An adapter should supervise processes of Mongo.Connection and provide the run/2 function to execute an anonymous function with a connection from the pool.

Source

Types

name :: atom

Callbacks

run/2

Specs:

  • run(name, (pid -> return)) :: {queue_time :: integer, return} when return: var

Runs the function with a checked out connection from the pool, after the function returns the pool should reclaim the connection.

Source
start_link/2

Specs:

Starts any connection pooling and supervision.

Source