[erlang-questions] Intrusive function intercept
Loïc Hoguin
essen@REDACTED
Fri Oct 11 11:30:31 CEST 2013
do_something() could be added automatically with a parse_transform
though. Nobody would have to worry about it and the code wouldn't be
cluttered.
On 10/11/2013 11:19 AM, Tyron Zerafa wrote:
> First - I do not want to clutter my code with /do_something(); /I need
> this perform this call multiple times at different places.
> Second -/ do_something()/ performs some access control logic, /test()
> /is any other function accessing resources. Ideally, developers writing
> /test()/ functions wouldn't have to worry about access control (this
> should be hidden).
>
>
> On Thu, Oct 10, 2013 at 3:48 PM, Wes James <comptekki@REDACTED
> <mailto:comptekki@REDACTED>> wrote:
>
> Why are you trying to monitor with B. Why not just do:
>
> test() ->
> x(),
> do_something(),
> y(),
> z().
>
> -wes
>
>
>
> On Thu, Oct 10, 2013 at 2:02 AM, Tyron Zerafa
> <tyron.zerafa@REDACTED <mailto:tyron.zerafa@REDACTED>> wrote:
>
> Hi,
> I would like to monitor a process and suspend the execution
> of certain functions to perform some other computation before.
> For instance consider a process A which executing the following
> simple function.
>
> test() ->
> x(),
> y(),
> z().
>
> I would like to initiate a process, B, that monitors the
> execution of A.
> I want B to:
> 1) stop A before function y is executed
> 2) execute some logic
> 3) resumes the execution of A (by executing Y and Z)
>
> So far, I have been following this post
> <http://erlang.org/pipermail/erlang-questions/2003-January/006679.html>
> and managed to determine when the y() function call was being
> done, but cannot suspend its execution. Any ideas how I can
> achieve this?
>
> Thanks
> Tyron
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED <mailto:erlang-questions@REDACTED>
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
>
>
>
> --
> Best Regards,
> Tyron Zerafa
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
--
Loïc Hoguin
Erlang Cowboy
Nine Nines
http://ninenines.eu
More information about the erlang-questions
mailing list