Contenu connexe
Similaire à Chapter16 (20)
Chapter16
- 2. • OPT
• Server – Basic
• Server – Transaction
• Server – Hot Code Swapping
• Server – More Fun
• gen_server
• gen_server Template
• my_bank.erl
- 3. OTP
• Open Telecom Platform : Application Framework
• Behavior – 비기능적인 부분
ex) 무정지 기능 , Hot Code Swapping … )
• Callback – 비즈니스 로직
- 8. gen_server
http://www.erlang.org/doc/man/gen_server.html
1.Callback Module Name
my_bank
2.Write Interface Routines
start(), stop(),
new_account(Who),
deposit(Who, Amount),
withdraw(Who, Amount)
3.Write Callback Routines
init/1,
handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3