我尝试将消息投射到 gen_server:
gen_server:cast({global, ID}, {watchers}).
处理程序是:
handle_cast({watchers}, State) ->
case State#table_state.watchers of
[] ->
{reply, no_watchers, State};
_ ->
{reply, State#table_state.watchers, State}
end;
但是当我执行gen_server:cast
gen_server 时出现错误:
=ERROR REPORT==== 29-Apr-2011::18:26:07 ===
** Generic server 1 terminating
** Last message in was {'$gen_cast',{watchers}}
** When Server state == {table_state,1,"1",11,[]}
** Reason for termination ==
** {bad_return_value,{reply, no_watchers, {table_state,3,"3",11,[]}}}
为什么我会得到bad_return_value
?