<div dir="ltr"><div>Hi,</div><div><br></div><div>I have these lines code:</div><div><br></div><div><div> timer:apply_after(5*1000,mymodule,myfunction,[Value]),</div></div><div> timer:apply_after(5*1000,mymodule,myfunction,[Value]),<br></div><div> timer:apply_after(5*1000,mymodule,myfunction,[Value]),<br></div><div> timer:apply_after(5*1000,mymodule,myfunction,[Value]),<br></div><div> timer:apply_after(5*1000,mymodule,myfunction,[Value]),<br></div><div><br></div><div>"myfunction" looks like this:</div><div>myfunction(Value)-></div><div><div><br></div><div>Val2=iolist_to_binary([Value,"_P"]),</div><div><br></div><div>case pg2:get_members(Value2) of</div><div> </div><div> [] -> </div><div> {ok,P}=mymodule:start_link(),<br></div><div> pg2:join(Value2,P2),</div><div> gen_server:call(P2,{push,Msg});</div><div> Otherwise -> <br></div><div> [Px|_]=Otherwise,</div><div> gen_server:call(Px,{push,Msg})</div><div> end, </div></div><div><br></div><div>the problem is instead of creating a single process of mymodule.</div><div>there are 5 processes, as time taken to register the process is more,</div><div><br></div><div>Any solution to this problem?</div><div><br></div><div><br></div><div>Regards,</div><div>Avinash D' Silva</div>
</div>