Skip to content

Commit

Permalink
minor doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
CurtTilmes committed May 3, 2017
1 parent c1ad924 commit 895b51d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
10 changes: 7 additions & 3 deletions META6.json
@@ -1,23 +1,27 @@
{
"name" : "DBI::Async",

"description" : "Tiny async wrapper around DBIish",

"auth" : "github:CurtTilmes",

"version" : "0.1",

"source-url" : "https://github.com/CurtTilmes/perl6-dbi-async.git",

"perl" : "6.c",

"tags" : [ "DBI" ],

"provides" : {
"DBI::Async" : "lib/DBI/Async.pm"
},

"depends" : [ "DBIish" ],

"description" : "Tiny async wrapper around DBIish",

"test-depends" : [ "Test" ],

"license" : "NASA",
"license" : "NASA-1.3",

"authors" : [ "Curt Tilmes <Curt.Tilmes@nasa.gov>" ],

Expand Down
8 changes: 5 additions & 3 deletions README.md
Expand Up @@ -58,6 +58,8 @@ SYNOPSIS
DESCRIPTION
===========

`DBI::Async` is an experimental wrapper around DBIish that does all the heavy lifting. It manages a pool of connections and as queries are issued, it queues them and allocates them to a connection, gets the results and returns them asynchronously. You can issue queries from multiple threads without worrying about managing connections. It also wraps some of the mechanics of dealing with results.

Passes all arguments to DBI::Async.new() through to DBIish.connect() except connections.

my $db = DBI::Async.new('Pg', connections => 5);
Expand Down Expand Up @@ -116,7 +118,7 @@ or
}

PROMISES
========
--------

If you include the :async adverb in a call to query(), instead of waiting for the result, a Promise will be returned that will be kept when the results of the database query are available.

Expand All @@ -140,10 +142,10 @@ You can have more outstanding queries than you have database connections availab

This allocates 10 database handles, then processes the 100 queries in parallel, 10 at a time. Since the results are processed with array(), the handles are returned to the pool immediately when the result is returned.

Make sure you don't take up too many waiting threads without leaving enough open threads to get work done and return handles for the rest of the waiting queries. You may be able to get around this by increasing $RAKUDO_MAX_THREADS. See: https://github.com/rakudo/rakudo/pull/1004
Make sure you don't take up too many waiting threads without leaving enough open threads to get work done and return handles for the rest of the waiting queries. You may be able to get around this by increasing $RAKUDO_MAX_THREADS. Also see: https://github.com/rakudo/rakudo/pull/1004

RETRIES
=======
-------

DBI::Async aggressively tries to open a database connection. If the connection can't be made immediately, it will sleep a while and try again, 1 second, then 2 seconds, then 3 seconds... up to 60 seconds, finally trying to open the database connection every 60 seconds. This happens both on inital database handle creation, or on subsequent reuse of an existing handle where the connection is dropped.

Expand Down
13 changes: 10 additions & 3 deletions lib/DBI/Async.pm
Expand Up @@ -208,6 +208,13 @@ DBI::Async - Tiny async wrapper around DBIish
=head1 DESCRIPTION
C<DBI::Async> is an experimental wrapper around DBIish that does all
the heavy lifting. It manages a pool of connections and as queries
are issued, it queues them and allocates them to a connection, gets
the results and returns them asynchronously. You can issue queries
from multiple threads without worrying about managing connections. It
also wraps some of the mechanics of dealing with results.
Passes all arguments to DBI::Async.new() through to DBIish.connect()
except connections.
Expand Down Expand Up @@ -282,7 +289,7 @@ or
}
}
=head1 PROMISES
=head2 PROMISES
If you include the :async adverb in a call to query(), instead of
waiting for the result, a Promise will be returned that will be kept
Expand Down Expand Up @@ -318,9 +325,9 @@ Make sure you don't take up too many waiting threads without leaving
enough open threads to get work done and return handles for the rest
of the waiting queries. You may be able to get around this by
increasing $RAKUDO_MAX_THREADS.
See: https://github.com/rakudo/rakudo/pull/1004
Also see: https://github.com/rakudo/rakudo/pull/1004
=head1 RETRIES
=head2 RETRIES
DBI::Async aggressively tries to open a database connection. If the
connection can't be made immediately, it will sleep a while and try
Expand Down

0 comments on commit 895b51d

Please sign in to comment.