mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-29 16:58:34 +00:00
fix: expvar error when observatory is not enabled & various typos
This commit is contained in:
parent
70306c4ec8
commit
755268b7d4
4 changed files with 12 additions and 7 deletions
|
@ -25,11 +25,11 @@ type Counter interface {
|
|||
//
|
||||
// xray:api:stable
|
||||
type Channel interface {
|
||||
// Channel is a runnable unit.
|
||||
// Runnable implies that Channel is a runnable unit.
|
||||
common.Runnable
|
||||
// Publish broadcasts a message through the channel with a controlling context.
|
||||
Publish(context.Context, interface{})
|
||||
// SubscriberCount returns the number of the subscribers.
|
||||
// Subscribers returns all subscribers.
|
||||
Subscribers() []chan interface{}
|
||||
// Subscribe registers for listening to channel stream and returns a new listener channel.
|
||||
Subscribe() (chan interface{}, error)
|
||||
|
@ -47,7 +47,7 @@ func SubscribeRunnableChannel(c Channel) (chan interface{}, error) {
|
|||
return c.Subscribe()
|
||||
}
|
||||
|
||||
// UnsubscribeClosableChannel unsubcribes the channel and close it if there is no more subscriber.
|
||||
// UnsubscribeClosableChannel unsubscribes the channel and close it if there is no more subscriber.
|
||||
func UnsubscribeClosableChannel(c Channel, sub chan interface{}) error {
|
||||
if err := c.Unsubscribe(sub); err != nil {
|
||||
return err
|
||||
|
@ -73,7 +73,7 @@ type Manager interface {
|
|||
|
||||
// RegisterChannel registers a new channel to the manager. The identifier string must not be empty, and unique among other channels.
|
||||
RegisterChannel(string) (Channel, error)
|
||||
// UnregisterCounter unregisters a channel from the manager by its identifier.
|
||||
// UnregisterChannel unregisters a channel from the manager by its identifier.
|
||||
UnregisterChannel(string) error
|
||||
// GetChannel returns a channel by its identifier.
|
||||
GetChannel(string) Channel
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue