<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi Alex:
<div><br>
<b>the process 1 follow:</b><br>
process_flag(trap_exit, true),
<div>....</div>
<div>...</div>
<div>{ok, Tag, Pid} = tcloud_mq_amqp_func:tc_subdesc_queue(ReadChannel, Que, MFA), %% subscribe the queue with process 2 start with MFA</div>
<div>%% and after this code, the process 1 do nothing but wait for call/cast process 1 is a gen_server.</div>
<div>%% process 1 never do unbind/delete opertion to the queue or any other thing</div>
<div><br>
</div>
<div><br>
</div>
<div><b>the process 2 follow:</b></div>
<div>loop() -> %% loop/0 is the F of MFA that start the process 2</div>
<div>receive</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>Msg -></div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>io:format("Msg:~p~n", [Msg]),</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>loop() </div>
<div>end</div>
<div><br>
</div>
<div>Regard</div>
<div>David<br>
<div><br>
<br>
________________________________________<br>
发件人: Alexandru Scvorţov [scvalex@gmail.com] 代表 Alexandru Scvorţov [alexandru@rabbitmq.com]<br>
发送时间: 2012年2月10日 17:38<br>
到: Liuzhuofu<br>
Cc: rabbitmq-discuss@lists.rabbitmq.com<br>
主题: Re: [rabbitmq-discuss] Can't process_flag(trap_exit, true) in process<br>
<br>
Hi David,<br>
<br>
> I create a connection and channel in process 1, and subscribe a queue with process 2, which created by "spawn_link" in process 1, if I run "process_flag(trap_exit, true)" in process 1, the process 2 will receive a 'basic.cancel' message for the subscribe
queue. If I don't run "process_flag(trap_exit, true)" in process 1, the process 2 will never receive that.<br>
<br>
I don't follow. Are you saying that running "process_flag(trap_exit,<br>
true)" in process 1, the queue will get deleted immediately (and hence<br>
process 2 will receive a basic.cancel)?<br>
<br>
Could you post your code please?<br>
<br>
Cheers,<br>
Alex<br>
<br>
On Fri, Feb 10, 2012 at 08:22:10AM +0000, Liuzhuofu wrote:<br>
> Hi all:<br>
> I found a strange thing:<br>
> I create a connection and channel in process 1, and subscribe a queue with process 2, which created by "spawn_link" in process 1, if I run "process_flag(trap_exit, true)" in process 1, the process 2 will receive a 'basic.cancel' message for the subscribe
queue. If I don't run "process_flag(trap_exit, true)" in process 1, the process 2 will never receive that.<br>
> Why ?<br>
><br>
> Regards,<br>
> David<br>
<br>
> _______________________________________________<br>
> rabbitmq-discuss mailing list<br>
> rabbitmq-discuss@lists.rabbitmq.com<br>
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss<br>
<br>
</div>
</div>
</div>
</div>
</body>
</html>