[erlang-questions] Erlang way for process-as-library?
Tue Feb 6 09:01:30 CET 2007
If you hide them in your eDoc, for example, the users wont know about
them. Unless they really checked they were there, and in that case
they want to know about them.
On 2/6/07, Robert Baruch <autophile@REDACTED> wrote:
> Thanks for all the advice -- I've decided to provide a start and
> start_link function, and let the user decide how to start the library
> up, documenting very carefully that the user *must* start the library
> before calling its functions.
> Now, the next question I have is: is there an Erlang way to forbid
> "ordinary users" from calling the server's callback functions
> directly (e.g. init, terminate, and so on), while allowing gen_server
> access to them? The problem is that my exports for my library look
> like this:
> % Public functions
> -export([start_link/0, start/0, getBlockRange/1, getCategoryRange/1]).
> % gen_server callbacks
> -export([init/1, handle_call/3, handle_cast/2, terminate/2]).
> -export([handle_info/2, code_change/3]).
> Do I really have to rely on a user's goodwill not to call the
> callbacks directly for whatever nefarious reason? :)
> erlang-questions mailing list
More information about the erlang-questions