Skip to content

Instantly share code, notes, and snippets.

@luca3m
Created May 27, 2014 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luca3m/aef4edaa95d97e41792b to your computer and use it in GitHub Desktop.
Save luca3m/aef4edaa95d97e41792b to your computer and use it in GitHub Desktop.
Simple pool with lambda
simple_pool::ptr_t pool = simple_pool::create();
// Calls block with a valid connection, retrying if something fails
pool->run_with_connection<void>([&](connection::ptr_t conn)
{
conn->run(command("SET")("foo")("bar"));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment