简体   繁体   中英

Storing multiple structures in gen_server state

How does one store multiple structures/items in a gen_server's state?

I want to store a reference to an ets table, as well as a queue and a counter(integer).

Thanks

使用记录?

-record(state, {table, queue, counter}).

A gen_server's state is just an arbitrary erlang term. Use whatever is most convenient (a record, a tuple, a list, a dict, whatever)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM