Using OTP

Joel Reymont joelr1@REDACTED
Sat Jan 14 20:36:58 CET 2006


On Jan 14, 2006, at 7:09 PM, Pupeno wrote:

> What I am doing is slightly different. I am making a gen_ (gen_echo  
> for
> example) from which other programs (like echo, supervised or not)  
> can be
> done. That is, I am writing code analogous to gen_server.
> My question is if I should use gen_server, copy and paste it, or what.

I'm doing something similar for my poker test harness. I'm making the  
poker bot a gen_server so that it can be properly supervised, etc.  
Poker bots are given a "script" module to execute. The module exports  
just one function that the poker bot calls with tcp, etc. events.

This is analogous to making a callback module for gen_server but  
simpler. I suppose there's no harm in making both your server harness  
_and_ the protocol handlers into gen_servers.

	Joel

--
http://wagerlabs.com/








More information about the erlang-questions mailing list