github.com/klaytn/klaytn@v1.12.1/event/doc.go (about) 1 // Copyright 2018 The klaytn Authors 2 // Copyright 2014 The go-ethereum Authors 3 // This file is part of the go-ethereum library. 4 // 5 // The go-ethereum library is free software: you can redistribute it and/or modify 6 // it under the terms of the GNU Lesser General Public License as published by 7 // the Free Software Foundation, either version 3 of the License, or 8 // (at your option) any later version. 9 // 10 // The go-ethereum library is distributed in the hope that it will be useful, 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 // GNU Lesser General Public License for more details. 14 // 15 // You should have received a copy of the GNU Lesser General Public License 16 // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. 17 // 18 // This file is derived from event/event.go (2018/06/04). 19 // Modified and improved for the klaytn development. 20 21 /* 22 Package event deals with subscriptions to real-time events. 23 24 Package event provides three different types of event dispatchers and different go-routines in a node can receive/send data by using it. 25 26 Source Files 27 28 Each file provides the following features 29 30 - event.go: Provides `TypeMux` struct which dispatches events to registered receivers. Receivers can be registered to handle events of a certain type 31 - feed.go: Provides `Feed` struct implements one-to-many subscriptions where the carrier of events is a channel. Values sent to a Feed are delivered to all subscribed channels simultaneously. Feeds can only be used with a single type 32 - subscription.go: Provides `Subscription` interface which represents a stream of events. The carrier of the events is typically a channel but isn't part of the interface. Subscriptions can fail while established and failures are reported through an error channel 33 34 */ 35 package event