Handle HAVE_ALL and HAVE_NONE. Cleanup the BITFIELD message.
[etorrent.git] / lib / etorrent-1.0 / src / etorrent_fs_pool_sup.erl
blob59b1c2c1bb1d0adf32e23a2fb66a19d3ff741001
1 %%%-------------------------------------------------------------------
2 %%% File : etorrent_fs_pool_sup.erl
3 %%% Author : Jesper Louis Andersen <>
4 %%% Description : Supervise a set of file system processes.
5 %%%
6 %%% Created : 21 Aug 2007 by Jesper Louis Andersen <>
7 %%%-------------------------------------------------------------------
8 -module(etorrent_fs_pool_sup).
10 -behaviour(supervisor).
12 %% API
13 -export([start_link/0, add_file_process/3]).
15 %% Supervisor callbacks
16 -export([init/1]).
18 -define(SERVER, ?MODULE).
20 %%====================================================================
21 %% API functions
22 %%====================================================================
23 %%--------------------------------------------------------------------
24 %% Function: start_link() -> {ok,Pid} | ignore | {error,Error}
25 %% Description: Starts the supervisor
26 %%--------------------------------------------------------------------
27 start_link() ->
28 supervisor:start_link(?MODULE, []).
30 %%--------------------------------------------------------------------
31 %% Function: add_file_process/2
32 %% Description: Add a new process for maintaining a file.
33 %%--------------------------------------------------------------------
34 add_file_process(Pid, TorrentId, Path) ->
35 supervisor:start_child(Pid, [Path, TorrentId]).
37 %%====================================================================
38 %% Supervisor callbacks
39 %%====================================================================
40 init([]) ->
41 FSProcesses = {'FSPROCESS',
42 {etorrent_fs_process, start_link, []},
43 transient, 2000, worker, [etorrent_fs_process]},
44 {ok, {{simple_one_for_one, 1, 60}, [FSProcesses]}}.
46 %%====================================================================
47 %% Internal functions
48 %%====================================================================