Documentation ¶
Overview ¶
Package orderwatcher contains the watchdog and state distribution system, and thus handles most of the fault tolerance in the elevator system. Orders on the network are stored in a local database, which is regularly distributed and synced with the other elevators on the network.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartDbDistributor ¶
StartDbDistributor starts distributing the database of orders. It compresses the file and publishes it as a DbMsg on the network.
func StartOrderWatcher ¶
func StartOrderWatcher(callsForSale chan types.Call, db *bolt.DB, quit <-chan int, wg *sync.WaitGroup)
StartOrderWatcher starts the order watcher, which listens for call sales and order deliveries on the network, and updates a local database that stores all orders. It traverses the database at regular intervals and sends orders that take too long to deliver to the seller. The order watcher also listens for database files sent by the other db distributors and synchronizes them with the local database. An order watcher subscribes to sale acknowledgements, order deliveries and db distribution messages.
Types ¶
This section is empty.