-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(vivid): optimize actor reference handling and mod status man…
…agement Optimize the way actor references are handled, removing the GetActorIdByActorReffunction and using the new Id() method directly from the ActorRef interface. This change simplifies the retrieval of actor IDs and improves code clarity. Update mod status management by introducing modStatus enum and related methods setStatus and getStatus, replacing the previous boolean flags. This enum-basedapproach enhances the readability and maintainability of the mod lifecycle management. BREAKING CHANGE: GetActorIdByActorRef function has been removed. Update yourcode to use the new Id() method from the ActorRef interface. Modified files: - event_bus.go: use Id() method for producerActorId assignment - message_context.go: add Terminated() and SetIdleTimeout() methods - message_options.go: remove outdated comment about WithInstantly option - mod.go: introduce modStatus enum and related methods - object_pool.go: rename Release method to Put for consistency- various tests: update according to the changes in the codebase
- Loading branch information
1 parent
4732b99
commit 1220b60
Showing
11 changed files
with
67 additions
and
40 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
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,30 @@ | ||
package log | ||
|
||
import ( | ||
"context" | ||
"log/slog" | ||
) | ||
|
||
// NewSilentLogger 创建一个静默日志记录器,该记录器不会输出任何日志 | ||
func NewSilentLogger() *Logger { | ||
return slog.New(new(SilentHandler)) | ||
} | ||
|
||
type SilentHandler struct { | ||
} | ||
|
||
func (s SilentHandler) Enabled(ctx context.Context, level slog.Level) bool { | ||
return false | ||
} | ||
|
||
func (s SilentHandler) Handle(ctx context.Context, record slog.Record) error { | ||
return nil | ||
} | ||
|
||
func (s SilentHandler) WithAttrs(attrs []slog.Attr) slog.Handler { | ||
return nil | ||
} | ||
|
||
func (s SilentHandler) WithGroup(name string) slog.Handler { | ||
return nil | ||
} |
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