Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge/upstream to 1.5.1 #10

Merged
merged 92 commits into from
Jan 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
a50e24e
Added Timeout for poolboy:transaction
lefan Sep 28, 2012
fc8312d
Add EXPM package definitions
Oct 10, 2012
7e6ac40
App version should be 0.9.1
dmitriid Nov 17, 2012
08c5b1d
Merge pull request #19 from dmitriid/patch-1
Nov 17, 2012
771b423
Change gen_fsm to gen_server behaviour
ddosia Dec 1, 2012
c73c97a
Fix wrong status
ddosia Dec 2, 2012
6ddc61a
Merge pull request #20 from ddosia/dch-gen_server
Dec 18, 2012
fb9242b
Merge commit 'a50e24e3c30b1b0bddc3511eac5661d110885f6a'
Jan 17, 2013
2a03513
Add latest versions of Erlang to our Travis tests
Jan 17, 2013
b256f3e
Add R16B to our Travis suite
Mar 22, 2013
3e922c0
Manage the version from a VERSION file, addressing #23
Apr 4, 2013
43bcfb9
Clean up .gitignore
Apr 4, 2013
57f43e7
Clean up Makefile, built the PLT before dialyzing
Apr 4, 2013
5e74254
Bump to 1.0.0-dev as per SemVer recommendations
Apr 5, 2013
74e61fd
Add 'qc' to PHONY targets
Apr 5, 2013
0341be6
Fix wait_valid to stop relying on term ordering rules to be correct #24
Apr 5, 2013
91b68de
Release 1.0.0
Apr 16, 2013
6008f22
Use a deadline from the calling process
Oct 10, 2013
c2c939b
Release 1.0.1
Oct 10, 2013
3899c40
Monitor calling process during wait
Oct 25, 2013
93e3882
Cancel waiting when a checkout fails
Oct 25, 2013
8c1e17c
Delete the downed process from monitors before handing off
Oct 25, 2013
ae05fd3
Dialyzer optimizations for newer Erlang releases
drobakowski Jan 9, 2014
0213922
Don't change the default pool sizes until a major release
Jan 13, 2014
7c340a9
Correct the README example to use trap_exit
Jan 13, 2014
ed1e691
We don't use a gen_fsm anymore
Jan 13, 2014
8e127a6
Add a .editorconfig
Jan 13, 2014
124a53a
Update .travis.yml
Jan 13, 2014
3ac9cc1
Bump version to 1.1.0
Jan 13, 2014
5bbfc1a
Replaced behaviour_info/1 with new -callback specs
drobakowski Jan 14, 2014
d47df5d
Merge pull request #38 from synlay/feature/behaviour_callback_refacto…
Jan 14, 2014
6439e69
Add a Bitdeli badge to README
bitdeli-chef Feb 12, 2014
e53a578
Merge pull request #40 from bitdeli-chef/master
Feb 12, 2014
1aae528
Add R16B03, R16B03-1 and 17.0-rc1 to .travis.yml
kiela Feb 13, 2014
3cc20d0
Merge pull request #41 from kiela/master
Feb 13, 2014
5ceae40
Compatibility with 17.0-rc2
ericmj Feb 28, 2014
64e1eae
Merge pull request #42 from ericmj/compat-17
Feb 28, 2014
db4df15
Update .travis.yml
Apr 18, 2014
65f7cbc
Bump the version to 1.2.0 and add a Hex package definition
Apr 24, 2014
bd938d6
Include version in package.exs
Apr 28, 2014
1c12075
Merge pull request #48 from josevalim/patch-1
Apr 28, 2014
5abc5f9
Bump version to 1.2.1
Apr 28, 2014
65235d0
Use workers as a stack, not a queue
May 2, 2014
9c4b458
Merge pull request #50 from arjan/worker-stack
May 3, 2014
e45f4ba
Don't warn about queue type on 17.0
May 9, 2014
828ea4e
We're done supporting R15
May 9, 2014
dd0c93b
make pool related typespecs conform to gen_server
sasa1977 May 20, 2014
0e9b565
fix supervisor typespecs
sasa1977 May 20, 2014
d654459
Merge pull request #51 from sasa1977/fix/pool-typespecs
May 20, 2014
bd58abe
Move gen:start_ret/0 type definition into poolboy.
hlieberman May 21, 2014
91cf587
Merge pull request #52 from hlieberman/master
May 21, 2014
0411a18
FIX clean shutdown in supervision tree
quiquepaz Jul 25, 2014
c1485b9
Correctly shutdown the worker supervisor
Jul 25, 2014
2c7840d
Bump version to 1.2.2
Jul 25, 2014
1d97fac
Update README
Jul 25, 2014
e937fdc
Update .travis.yml
Aug 10, 2014
24e30fc
Merge branch 'clean_shutdown' of github.com:quiquepaz/poolboy into qu…
Aug 10, 2014
17d1582
Bump version to 1.3.0
Aug 10, 2014
0d4082d
Update README.md
Aug 31, 2014
eea9d25
allow pids in typespecs
sasa1977 Oct 2, 2014
8222fef
Merge pull request #57 from sasa1977/fix/typespec
Oct 2, 2014
4439504
Fix setting monitors on calling processes
ppikula Oct 14, 2014
e514fb2
Merge pull request #58 from ppikula/fix_monitors
Oct 19, 2014
22ef602
Add 17.3 to .travis.yml
Oct 19, 2014
0d5d032
Fix dependency compile issue, when add poolboy into cowboy Makefile, …
Oct 21, 2014
187ef6f
which command probably make build failed
Oct 22, 2014
e386eaf
Demonitor process when checkout request is cancelled
Oct 29, 2014
7632965
Bump version to 1.4.0
Oct 29, 2014
31170d0
Adds support for FIFO strategy
JYZR Nov 5, 2014
52d87c2
Merge pull request #60 from JYZR/fifo-support
Dec 3, 2014
94a3f7a
Reuse the waiting monitor when a worker exits
Dec 3, 2014
2d94d5b
Bump to version 1.4.1
Dec 3, 2014
0a40d6b
Move to ISC for optional license
Dec 13, 2014
86ba585
Update license section of the README
Dec 13, 2014
fa87a6e
Hardcode the version within the .app.src for now (Windows)
Dec 13, 2014
81c59c6
Update README.md
Dec 13, 2014
96d2025
Update README.md
Dec 13, 2014
7899566
reproduce an issue
Feb 10, 2015
a4a3e4f
make sure that client process termination leads to proper pool clean up
Feb 12, 2015
f73986c
Update README to point to epgsql
davidw Mar 6, 2015
b724a71
Merge pull request #68 from davidw/master
Mar 6, 2015
3170cea
Export pool/0 type
bullno1 Mar 12, 2015
42c6317
Merge pull request #69 from bullno1/patch-1
Mar 26, 2015
1574805
Fix race condition on checkout timeout
fishcakez Apr 10, 2015
5c1c58b
Merge pull request #70 from fishcakez/cancel_racecon
Apr 10, 2015
27c3886
Merge pull request #59 from JoshuaChi/master
Apr 10, 2015
fbb39db
Update .travis.yml
Apr 10, 2015
3b341fa
Travis doesn't support 17.5 yet
Apr 10, 2015
28778a7
Release 1.5.0
Apr 10, 2015
3bb48a8
Release 1.5.1
Apr 12, 2015
be8f60f
Merge tag '1.5.1' into merge/upstream
Jan 5, 2017
2b41ca9
Add tools.mk
Jan 5, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Empty file removed .dialyzer-ignore-warnings
Empty file.
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# 4 space indentation
[*.{erl,src}]
indent_style = space
indent_size = 4
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*.app
*.beam
.test
.rebar
.eunit
.dialyzer_plt
erl_crash.dump
ebin
14 changes: 10 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ notifications:
webhooks: http://basho-engbot.herokuapp.com/travis?key=f298b56e20009568a29135485bca1220d0733d05
email: eng@basho.com
otp_release:
- R15B01
- R15B
- R14B04
- R14B03
- 17.4
- 17.3
- 17.1
- 17.0
- R16B03-1
- R16B03
- R16B02
- R16B01
- R16B
sudo: false
190 changes: 13 additions & 177 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,177 +1,13 @@

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS
Copyright (c) 2014, Devin Alexander Torres <devin@devintorr.es>

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
37 changes: 14 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,32 +1,23 @@
REBAR = ./rebar
DIALYZER = dialyzer
.PHONY: deps test

DIALYZER_WARNINGS = -Wunmatched_returns -Werror_handling \
-Wrace_conditions -Wunderspecs
DIALYZER_FLAGS =

.PHONY: all compile test clean get-deps build-plt dialyze
all: deps compile

all: compile
compile: deps
./rebar compile

compile:
@$(REBAR) compile

test: compile
@$(REBAR) eunit skip_deps=true

qc: compile
@$(REBAR) qc skip_deps=true
deps:
./rebar get-deps

clean:
@$(REBAR) clean
./rebar clean
rm -rf test.*-temp-data

get-deps:
@$(REBAR) get-deps
distclean: clean
./rebar delete-deps

build-plt:
@$(DIALYZER) --build_plt --output_plt .dialyzer_plt \
--apps kernel stdlib
DIALYZER_APPS = kernel stdlib sasl erts ssl tools os_mon runtime_tools crypto inets \
xmerl public_key mnesia eunit syntax_tools compiler

dialyze: compile
@$(DIALYZER) --src src --plt .dialyzer_plt $(DIALYZER_WARNINGS) | \
fgrep -vf .dialyzer-ignore-warnings
include tools.mk
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

[![Build Status](https://secure.travis-ci.org/basho/poolboy.png?branch=master)](http://travis-ci.org/basho/poolboy)

Poolboy is a **lightweight**, **generic** pooling library for Erlang with a
focus on **simplicity**, **performance**, and **rock-solid** disaster recovery.

## Usage

```erl-sh
Expand All @@ -16,7 +19,7 @@ ok
## Example

This is an example application showcasing database connection pools using
Poolboy and Will Glozer's [epgsql](https://github.com/wg/epgsql).
Poolboy and [epgsql](https://github.com/epgsql/epgsql).

### example.app

Expand Down Expand Up @@ -113,19 +116,20 @@ start_link(Args) ->
gen_server:start_link(?MODULE, Args, []).

init(Args) ->
process_flag(trap_exit, true),
Hostname = proplists:get_value(hostname, Args),
Database = proplists:get_value(database, Args),
Username = proplists:get_value(username, Args),
Password = proplists:get_value(password, Args),
{ok, Conn} = pgsql:connect(Hostname, Username, Password, [
{ok, Conn} = epgsql:connect(Hostname, Username, Password, [
{database, Database}
]),
{ok, #state{conn=Conn}}.

handle_call({squery, Sql}, _From, #state{conn=Conn}=State) ->
{reply, pgsql:squery(Conn, Sql), State};
{reply, epgsql:squery(Conn, Sql), State};
handle_call({equery, Stmt, Params}, _From, #state{conn=Conn}=State) ->
{reply, pgsql:equery(Conn, Stmt, Params), State};
{reply, epgsql:equery(Conn, Stmt, Params), State};
handle_call(_Request, _From, State) ->
{reply, ok, State}.

Expand All @@ -136,7 +140,7 @@ handle_info(_Info, State) ->
{noreply, State}.

terminate(_Reason, #state{conn=Conn}) ->
ok = pgsql:close(Conn),
ok = epgsql:close(Conn),
ok.

code_change(_OldVsn, State, _Extra) ->
Expand All @@ -149,6 +153,8 @@ code_change(_OldVsn, State, _Extra) ->
- `worker_module`: the module that represents the workers
- `size`: maximum pool size
- `max_overflow`: maximum number of workers created if pool is empty
- `strategy`: `lifo` or `fifo`, determines whether checked in workers should be
placed first or last in the line of available workers. Default is `lifo`.

## Authors

Expand All @@ -159,5 +165,5 @@ code_change(_OldVsn, State, _Extra) ->
## License

Poolboy is available in the public domain (see `UNLICENSE`).
Poolboy is also optionally available under the Apache License (see `LICENSE`),
Poolboy is also optionally available under the ISC license (see `LICENSE`),
meant especially for jurisdictions that do not recognize public domain works.
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.5.1
19 changes: 19 additions & 0 deletions package.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
defmodule Poolboy.Mixfile do
use Mix.Project

@version File.read!("VERSION") |> String.strip

def project do
[app: :poolboy,
version: @version,
description: "A hunky Erlang worker pool factory",
package: package]
end

defp package do
[files: ~w(src rebar.config README.md LICENSE UNLICENSE VERSION),
contributors: ["Devin Torres", "Andrew Thompson", "Kurt Williams"],
licenses: ["Unlicense", "Apache 2.0"],
links: %{"GitHub" => "https://github.com/devinus/poolboy"}]
end
end
Binary file modified rebar
Binary file not shown.
7 changes: 5 additions & 2 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{erl_opts, [debug_info, warnings_as_errors,
{platform_define, "^[0-9]+", namespaced_types}]}.
{erl_opts, [
debug_info, warnings_as_errors,
{platform_define, "^R", pre17}
]}.

{eunit_opts, [verbose]}.
{cover_enabled, true}.