Skip to content

Commit

Permalink
Merge branch 'release/1.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
g-andrade committed Oct 17, 2016
2 parents 9872b6c + 12e3289 commit c57de37
Show file tree
Hide file tree
Showing 23 changed files with 96 additions and 89 deletions.
42 changes: 42 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
REBAR = $(shell command -v rebar || echo ./rebar)
DEPS_PLT=./.deps_plt
DEPS=erts kernel stdlib

.PHONY: all get-deps compile clean dialyze xref

all: get-deps compile

get-deps:
@$(REBAR) get-deps

compile:
@$(REBAR) compile

#test: compile
# @ERL_AFLAGS="-config test/taskforce_tests.app.config" $(REBAR) eunit skip_deps=true

clean:
@$(REBAR) clean

$(DEPS_PLT):
@echo Building $(DEPS_PLT)
dialyzer --build_plt \
--output_plt $(DEPS_PLT) \
--apps $(DEPS)
#-r deps \
dialyze: compile $(DEPS_PLT)
dialyzer --fullpath \
--src src \
-Wunmatched_returns \
-Werror_handling \
-Wrace_conditions \
-Wunderspecs \
-r ebin \
--plt $(DEPS_PLT)

xref:
@$(REBAR) xref

doc: compile
./scripts/hackish_make_docs.sh
22 changes: 9 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ __Authors:__ Guilherme Andrade ([`g@gandrade.net`](mailto:g@gandrade.net)).

`taskforce` allows you to parallelise arbitrary tasks in a controlled way.


---------


Expand All @@ -32,13 +33,11 @@ IdentifiedUrls = [{google_homepage, "https://www.google.com/"},
{example_image1, "https://assets.crowdsurge.com/datacapture/example/img/example_logo.png"},
{example_image2, "http://underthebridge.co.uk/wp-content/uploads/2014/03/Example-main-image1.jpg"},
{example_image3, "https://assets-cdn.github.com/images/modules/logos_page/GitHub-Mark.png"}],

IndividualTimeoutT = 2000, % in miliseconds
GlobalTimeoutT = 10000, % in miliseconds
MinionCount = 4, % 4 workers

Tasks = [taskforce:new_task({download_result, Id}, DownloadFun, [Id, Url],
IndividualTimeoutT)
Tasks = [taskforce:new_task({download_result, Id}, DownloadFun, [Id, Url], IndividualTimeoutT)
|| {Id, Url} <- IdentifiedUrls],

{ResultsById, Individualtimeouts, GlobalTimeouts} = taskforce:execute_tasks(
Expand All @@ -56,10 +55,7 @@ Tasks = [taskforce:new_task({download_result, Id}, DownloadFun, [Id, Url],
% {1430,311508,810445} Handled 'google_homepage'
% {1430,311509,58815} Handled 'example_image3'
% {1430,311509,447087} Handled 'ip_over_avian_carriers_rfc'


lists:keyfind({download_result, hackernews_rss}, 1, ResultsById).

% {{download_result,hackernews_rss},
% {{"HTTP/1.1",200,"OK"},
% [{"cache-control","private"},
Expand All @@ -85,11 +81,11 @@ lists:keyfind({download_result, hackernews_rss}, 1, ResultsById).


<table width="100%" border="0" summary="list of modules">
<tr><td><a href="https://github.com/g-andrade/taskforce/blob/develop/doc/taskforce.md" class="module">taskforce</a></td></tr>
<tr><td><a href="https://github.com/g-andrade/taskforce/blob/develop/doc/taskforce_app.md" class="module">taskforce_app</a></td></tr>
<tr><td><a href="https://github.com/g-andrade/taskforce/blob/develop/doc/taskforce_sup.md" class="module">taskforce_sup</a></td></tr>
<tr><td><a href="https://github.com/g-andrade/taskforce/blob/develop/doc/tf_master_serv.md" class="module">tf_master_serv</a></td></tr>
<tr><td><a href="https://github.com/g-andrade/taskforce/blob/develop/doc/tf_master_sup.md" class="module">tf_master_sup</a></td></tr>
<tr><td><a href="https://github.com/g-andrade/taskforce/blob/develop/doc/tf_minion_serv.md" class="module">tf_minion_serv</a></td></tr>
<tr><td><a href="https://github.com/g-andrade/taskforce/blob/develop/doc/tf_minion_sup.md" class="module">tf_minion_sup</a></td></tr></table>
<tr><td><a href="https://github.com/g-andrade/taskforce/blob/master/doc/taskforce.md" class="module">taskforce</a></td></tr>
<tr><td><a href="https://github.com/g-andrade/taskforce/blob/master/doc/taskforce_app.md" class="module">taskforce_app</a></td></tr>
<tr><td><a href="https://github.com/g-andrade/taskforce/blob/master/doc/taskforce_sup.md" class="module">taskforce_sup</a></td></tr>
<tr><td><a href="https://github.com/g-andrade/taskforce/blob/master/doc/tf_master_serv.md" class="module">tf_master_serv</a></td></tr>
<tr><td><a href="https://github.com/g-andrade/taskforce/blob/master/doc/tf_master_sup.md" class="module">tf_master_sup</a></td></tr>
<tr><td><a href="https://github.com/g-andrade/taskforce/blob/master/doc/tf_minion_serv.md" class="module">tf_minion_serv</a></td></tr>
<tr><td><a href="https://github.com/g-andrade/taskforce/blob/master/doc/tf_minion_sup.md" class="module">tf_minion_sup</a></td></tr></table>

1 change: 1 addition & 0 deletions doc/edoc-info
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%% encoding: UTF-8
{application,taskforce}.
{packages,[]}.
{modules,[taskforce,taskforce_app,taskforce_sup,tf_master_serv,tf_master_sup,
tf_minion_serv,tf_minion_sup]}.
2 changes: 1 addition & 1 deletion doc/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Overview</title>
<title>Application: taskforce</title>
</head>
<frameset cols="20%,80%">
<frame src="modules-frame.html" name="modulesFrame" title="">
Expand Down
2 changes: 1 addition & 1 deletion doc/modules-frame.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Overview</title>
<title>Application: taskforce</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
</head>
<body bgcolor="white">
Expand Down
2 changes: 1 addition & 1 deletion doc/overview-summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@ <h1>taskforce</h1>

<hr>
<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<p><i>Generated by EDoc, Apr 29 2015, 13:56:48.</i></p>
<p><i>Generated by EDoc, Oct 17 2016, 23:13:23.</i></p>
</body>
</html>
2 changes: 1 addition & 1 deletion doc/packages-frame.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Overview</title>
<title>Application: taskforce</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
</head>
<body bgcolor="white">
Expand Down
2 changes: 1 addition & 1 deletion doc/taskforce.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ <h3 class="function"><a name="new_task-4">new_task/4</a></h3>
<hr>

<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<p><i>Generated by EDoc, Apr 29 2015, 13:56:48.</i></p>
<p><i>Generated by EDoc, Oct 17 2016, 23:13:23.</i></p>
</body>
</html>
42 changes: 4 additions & 38 deletions doc/taskforce.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* [Function Index](#index)
* [Function Details](#functions)



<a name="types"></a>

## Data Types ##
Expand All @@ -17,96 +15,80 @@
### <a name="type-execution_result">execution_result()</a> ###



<pre><code>
execution_result() = {Completed::<a href="#type-tf_proplist">tf_proplist</a>(<a href="#type-tf_task_id">tf_task_id()</a>, <a href="#type-tf_task_result">tf_task_result()</a>), IndividualTimeouts::[<a href="#type-tf_task_id">tf_task_id()</a>], GlobalTimeouts::[<a href="#type-tf_task_id">tf_task_id()</a>]}
</code></pre>





### <a name="type-tf_fun_args">tf_fun_args()</a> ###



<pre><code>
tf_fun_args() = [any()]
</code></pre>





### <a name="type-tf_fun_ref">tf_fun_ref()</a> ###



<pre><code>
tf_fun_ref() = function()
</code></pre>





### <a name="type-tf_proplist">tf_proplist()</a> ###



<pre><code>
tf_proplist(T1, T2) = [{T1, T2}]
</code></pre>





### <a name="type-tf_task">tf_task()</a> ###



<pre><code>
tf_task() = #tf_task{}
</code></pre>





### <a name="type-tf_task_id">tf_task_id()</a> ###



<pre><code>
tf_task_id() = any()
</code></pre>





### <a name="type-tf_task_result">tf_task_result()</a> ###



<pre><code>
tf_task_result() = any()
</code></pre>





### <a name="type-tf_timeout">tf_timeout()</a> ###



<pre><code>
tf_timeout() = pos_integer()
</code></pre>


<a name="index"></a>

## Function Index ##
Expand All @@ -123,51 +105,35 @@ tf_timeout() = pos_integer()

### execute_tasks/1 ###


<pre><code>
execute_tasks(Tasks::[<a href="#type-tf_task">tf_task()</a>]) -&gt; <a href="#type-execution_result">execution_result()</a>
</code></pre>

<br></br>


<br />

<a name="execute_tasks-2"></a>

### execute_tasks/2 ###


<pre><code>
execute_tasks(Tasks::[<a href="#type-tf_task">tf_task()</a>], TotalTimeout::<a href="#type-tf_timeout">tf_timeout()</a>) -&gt; <a href="#type-execution_result">execution_result()</a>
</code></pre>

<br></br>


<br />

<a name="execute_tasks-3"></a>

### execute_tasks/3 ###


<pre><code>
execute_tasks(Tasks::[<a href="#type-tf_task">tf_task()</a>], TotalTimeout::<a href="#type-tf_timeout">tf_timeout()</a>, MaxMinionCount::pos_integer()) -&gt; <a href="#type-execution_result">execution_result()</a>
</code></pre>

<br></br>


<br />

<a name="new_task-4"></a>

### new_task/4 ###


<pre><code>
new_task(Id::<a href="#type-tf_task_id">tf_task_id()</a>, FunRef::<a href="#type-tf_fun_ref">tf_fun_ref()</a>, Args::<a href="#type-tf_fun_args">tf_fun_args()</a>, Timeout::<a href="#type-tf_timeout">tf_timeout()</a>) -&gt; <a href="#type-tf_task">tf_task()</a>
</code></pre>

<br></br>


<br />

2 changes: 1 addition & 1 deletion doc/taskforce_app.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ <h1>Module taskforce_app</h1>
<hr>

<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<p><i>Generated by EDoc, Apr 29 2015, 13:56:48.</i></p>
<p><i>Generated by EDoc, Oct 17 2016, 23:13:23.</i></p>
</body>
</html>
1 change: 1 addition & 0 deletions doc/taskforce_app.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
# Module taskforce_app #

__Behaviours:__ [`application`](application.md).

2 changes: 1 addition & 1 deletion doc/taskforce_sup.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ <h3 class="function"><a name="start_link-0">start_link/0</a></h3>
<hr>

<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<p><i>Generated by EDoc, Apr 29 2015, 13:56:48.</i></p>
<p><i>Generated by EDoc, Oct 17 2016, 23:13:23.</i></p>
</body>
</html>
7 changes: 2 additions & 5 deletions doc/taskforce_sup.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* [Function Details](#functions)

__Behaviours:__ [`supervisor`](supervisor.md).

<a name="index"></a>

## Function Index ##
Expand All @@ -22,14 +23,10 @@ Starts the supervisor.</td></tr></table>

### start_link/0 ###


<pre><code>
start_link() -&gt; {ok, Pid} | ignore | {error, Error}
</code></pre>

<br></br>


<br />

Starts the supervisor

2 changes: 1 addition & 1 deletion doc/tf_master_serv.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ <h3 class="function"><a name="start_link-2">start_link/2</a></h3>
<hr>

<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<p><i>Generated by EDoc, Apr 29 2015, 13:56:48.</i></p>
<p><i>Generated by EDoc, Oct 17 2016, 23:13:23.</i></p>
</body>
</html>
7 changes: 2 additions & 5 deletions doc/tf_master_serv.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* [Function Details](#functions)

__Behaviours:__ [`gen_server`](gen_server.md).

<a name="index"></a>

## Function Index ##
Expand All @@ -22,14 +23,10 @@ Starts the server.</td></tr></table>

### start_link/2 ###


<pre><code>
start_link(PatronPid, MaxMinionCount) -&gt; {ok, Pid} | ignore | {error, Error}
</code></pre>

<br></br>


<br />

Starts the server

2 changes: 1 addition & 1 deletion doc/tf_master_sup.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ <h3 class="function"><a name="start_link-0">start_link/0</a></h3>
<hr>

<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<p><i>Generated by EDoc, Apr 29 2015, 13:56:48.</i></p>
<p><i>Generated by EDoc, Oct 17 2016, 23:13:23.</i></p>
</body>
</html>
Loading

0 comments on commit c57de37

Please sign in to comment.