[erlang-questions] Data in state records

Matthew Evans <>
Mon Mar 12 18:05:53 CET 2012


Hi,
Many of my processes (gen_servers) need to store some kind of indexed data in the state record. Usually this involves creating a set/dict/ets table in the init/1 function, assigning it to an element in the state record and using the data on each handle_call/cast/info.
My usual strategy is anything that is 100% private to my gen_server and will contain less than 50 or so records I will use sets/gb_trees or similar. In all other cases I would use an ETS table. Is there an official recommendation?
Thanks
Matt
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120312/6b8d0a4c/attachment.html>


More information about the erlang-questions mailing list