This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmodule my-supervisor | |
(export | |
(start 2) | |
(init 1) | |
(stop 1))) | |
(defun start (name child-spec-list) | |
"Start a supervisor with `name` and `child-spec-list`." | |
(let ((pid (spawn (MODULE) 'init (list child-spec-list)))) | |
(register name pid) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmodule coffee-fsm | |
(behaviour gen_fsm) | |
(export | |
(start-link 0) | |
(stop 0) | |
(handle_sync_event 4) | |
(init 1) | |
(terminate 3) | |
(selection 2) | |
(payment 2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmodule coffee | |
(export | |
(tea 0) | |
(espresso 0) | |
(americano 0) | |
(cappuccino 0) | |
(pay 1) | |
(cup-removed 0) | |
(cancel 0) | |
(start_link 0) |
NewerOlder