Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:19
episcina
episcina-1.1.0-git.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File episcina-1.1.0-git.patch of Package episcina
diff --git a/.gitignore b/.gitignore index 133f189..71d1cc1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +_build *.beam .* deps/* diff --git a/.travis.yml b/.travis.yml index 5e3e9d4..fa25216 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,14 @@ +sudo: false language: erlang otp_release: - 18.0 - 17.5 - R16B - - R15B02 - - R15B01 - - R15B -script: "make rebuild" +cache: + directories: + - $HOME/.cache/rebar3/hex/default/ +install: "true" # don't let travis run get-deps +script: "./rebar3 update && ./rebar3 eunit && ./rebar3 dialyzer" branches: only: - master diff --git a/Makefile b/Makefile deleted file mode 100644 index 445e292..0000000 --- a/Makefile +++ /dev/null @@ -1,100 +0,0 @@ -# Copyright 2012 Erlware, LLC. All Rights Reserved. -# -# This file is provided to you under the Apache License, -# Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -ERLFLAGS= -pa $(CURDIR)/.eunit -pa $(CURDIR)/ebin -pa $(CURDIR)/deps/*/ebin - -DEPS_PLT=$(CURDIR)/.deps_plt -DEPS=erts kernel stdlib - -# ============================================================================= -# Verify that the programs we need to run are installed on this system -# ============================================================================= -ERL = $(shell which erl) - -ifeq ($(ERL),) -$(error "Erlang not available on this system") -endif - -REBAR=$(shell which rebar) - -ifeq ($(REBAR),) -$(error "Rebar not available on this system") -endif - -.PHONY: all compile doc clean test dialyzer typer shell distclean pdf \ - update-deps clean-common-test-data rebuild - -all: deps compile dialyzer test - -# ============================================================================= -# Rules to build the system -# ============================================================================= - -deps: - $(REBAR) get-deps - $(REBAR) compile - -update-deps: - $(REBAR) update-deps - $(REBAR) compile - -compile: - $(REBAR) skip_deps=true compile - -doc: - $(REBAR) skip_deps=true doc - -eunit: compile clean-common-test-data - $(REBAR) skip_deps=true eunit - -test: compile eunit - -$(DEPS_PLT): - @echo Building local plt at $(DEPS_PLT) - @echo - - dialyzer --output_plt $(DEPS_PLT) --build_plt \ - --apps $(DEPS) -r deps - -dialyzer: test $(DEPS_PLT) - dialyzer --fullpath --plt $(DEPS_PLT) -Wrace_conditions -r ./ebin - -typer: - typer --plt $(DEPS_PLT) -r ./src - -shell: deps compile -# You often want *rebuilt* rebar tests to be available to the -# shell you have to call eunit (to get the tests -# rebuilt). However, eunit runs the tests, which probably -# fails (thats probably why You want them in the shell). This -# runs eunit but tells make to ignore the result. - - @$(REBAR) skip_deps=true eunit - @$(ERL) $(ERLFLAGS) - -pdf: - pandoc README.md -o README.pdf - -clean: - - rm -rf $(CURDIR)/test/*.beam - - rm -rf $(CURDIR)/logs - - rm -rf $(CURDIR)/ebin - $(REBAR) skip_deps=true clean - -distclean: clean - - rm -rf $(DEPS_PLT) - - rm -rvf $(CURDIR)/deps - -rebuild: distclean deps compile dialyzer test diff --git a/rebar.config b/rebar.config index c0cf54e..dc69d04 100644 --- a/rebar.config +++ b/rebar.config @@ -1,12 +1,7 @@ %% -*- mode: Erlang; fill-column: 80; comment-column: 75; -*- %% Dependencies ================================================================ -{deps, [{rebar_vsn_plugin, ".*", - {git, "https://github.com/erlware/rebar_vsn_plugin.git", - "fd40c960c7912193631d948fe962e1162a8d1334"}}, - {gproc, ".*", - {git, "https://github.com/uwiger/gproc.git", - {tag, "0.3"}}}]}. +{deps, [gproc]}. %% Compiler Options ============================================================ {erl_opts, @@ -21,5 +16,3 @@ {cover_enabled, true}. {cover_print_enabled, true}. -%% Rebar Plugins ============================================================== -{plugins, [rebar_vsn_plugin]}. diff --git a/rebar.lock b/rebar.lock new file mode 100644 index 0000000..dfb16e3 --- /dev/null +++ b/rebar.lock @@ -0,0 +1 @@ +[{<<"gproc">>,{pkg,<<"gproc">>,<<"0.3.1">>},0}]. diff --git a/rebar3 b/rebar3 new file mode 100755 index 0000000..63c1f92 Binary files /dev/null and b/rebar3 differ diff --git a/src/episcina.app.src b/src/episcina.app.src index 7319e3d..d191a73 100644 --- a/src/episcina.app.src +++ b/src/episcina.app.src @@ -1,6 +1,6 @@ {application, episcina, [{description, "Erlang Connection Pool"}, - {vsn, "semver"}, + {vsn, "1.1.0"}, {modules, []}, {registered, [episcina_sup]}, {mod, {epna_app, []}}, diff --git a/src/episcina.erl b/src/episcina.erl index 4eb0a7b..ccfb78f 100644 --- a/src/episcina.erl +++ b/src/episcina.erl @@ -20,7 +20,7 @@ connect_fun/0, close_fun/0]). --type name() :: binary() | atom(). +-type name() :: any(). -type connection() :: pid() | term(). -type connect_fun() :: fun(() -> term()). -type close_fun() :: fun((term()) -> ok). @@ -58,13 +58,13 @@ stop(Name) -> epna_pool:stop(Name). %% @doc Get a db connection, wait at most 10 seconds before giving up. --spec get_connection(name()) -> connection(). +-spec get_connection(name()) -> {ok, connection()}. get_connection(Name) -> epna_pool:get_connection(Name). %% @doc Get a db connection, wait at most Timeout seconds before %% giving up. --spec get_connection(name(), non_neg_integer()) -> connection(). +-spec get_connection(name(), non_neg_integer()) -> {ok, connection()}. get_connection(Name, Timeout) -> epna_pool:get_connection(Name, Timeout). diff --git a/src/epna_pool.erl b/src/epna_pool.erl index 1903e7f..0c447de 100644 --- a/src/epna_pool.erl +++ b/src/epna_pool.erl @@ -77,11 +77,11 @@ stop(Name) -> {Pid, _} = gproc:await(make_registered_name(Name)), gen_server:cast(Pid, stop). --spec get_connection(episcina:name()) -> episcina:connection(). +-spec get_connection(episcina:name()) -> {ok, episcina:connection()}. get_connection(Name) -> get_connection(Name, 10000). --spec get_connection(episcina:name(), non_neg_integer()) -> episcina:connection(). +-spec get_connection(episcina:name(), non_neg_integer()) -> {ok, episcina:connection()}. get_connection(Name, Timeout) -> {Time, {Pid, _}} = timer:tc(gproc, await, [make_registered_name(Name), Timeout]), @@ -94,6 +94,7 @@ get_connection(Name, Timeout) -> {error, timeout} end. +-spec return_connection(episcina:name(), episcina:connection()) -> ok. return_connection(Name, C) -> {Pid, _} = gproc:await(make_registered_name(Name)), gen_server:cast(Pid, {return_connection, C}).
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor