Skip to content

Commit

Permalink
Update actor.go
Browse files Browse the repository at this point in the history
fix actor Activate Deactivate interface
  • Loading branch information
wXwcoder authored Feb 19, 2024
1 parent d2528d7 commit 5d56a9d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions actor/actor.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,16 @@ func (b *ServerImplBase) SaveState() error {
return b.ctx.SaveState(context.Background())
}

// Activate when actor created by actor manager
func (b *ServerImplBase) Activate() error {
return nil
}

// Deactivate before actor removed by actor manager
func (b *ServerImplBase) Deactivate() error {
return nil
}

// Deprecated: Use ServerImplBaseCtx instead.
func (b *ServerImplBase) WithContext() *ServerImplBaseCtx {
b.ctx.lock.RLock()
Expand Down Expand Up @@ -187,6 +197,16 @@ func (b *ServerImplBaseCtx) SaveState(ctx context.Context) error {
return nil
}

// Activate when actor created by actor manager
func (b *ServerImplBaseCtx) Activate() error {
return nil
}

// Deactivate before actor removed by actor manager
func (b *ServerImplBaseCtx) Deactivate() error {
return nil
}

// Deprecated: StateManager is deprecated in favour of StateManagerContext.
type StateManager interface {
// Add is to add new state store with @stateName and @value
Expand Down

0 comments on commit 5d56a9d

Please sign in to comment.