This repository has been archived by the owner on Dec 28, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add --disable_disconnect parameter
- Loading branch information
Showing
7 changed files
with
71 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package node | ||
|
||
import "github.com/apex/log" | ||
|
||
// Disconnector is an interface for disconnect queue implementation | ||
type Disconnector interface { | ||
Run() error | ||
Shutdown() error | ||
Enqueue(*Session) error | ||
Size() int | ||
} | ||
|
||
// NoopDisconnectQueue is non-operational disconnect queue implementation | ||
type NoopDisconnectQueue struct{} | ||
|
||
// Run does nothing | ||
func (d *NoopDisconnectQueue) Run() error { | ||
log.WithField("context", "disconnector").Info("Disconnect events are turned off") | ||
return nil | ||
} | ||
|
||
// Shutdown does nothing | ||
func (d *NoopDisconnectQueue) Shutdown() error { | ||
return nil | ||
} | ||
|
||
// Size returns 0 | ||
func (d *NoopDisconnectQueue) Size() int { | ||
return 0 | ||
} | ||
|
||
// Enqueue does nothing | ||
func (d *NoopDisconnectQueue) Enqueue(s *Session) error { | ||
return nil | ||
} | ||
|
||
// NewNoopDisconnector returns new NoopDisconnectQueue | ||
func NewNoopDisconnector() *NoopDisconnectQueue { | ||
return &NoopDisconnectQueue{} | ||
} |
This file contains 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