Skip to content

Commit

Permalink
✨ feat: support async consume events and wait complete
Browse files Browse the repository at this point in the history
 - add some new global func
 - add more unit tests
  • Loading branch information
inhere committed Jun 9, 2023
1 parent ce4bdc7 commit c020267
Show file tree
Hide file tree
Showing 7 changed files with 653 additions and 484 deletions.
7 changes: 6 additions & 1 deletion event.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ type Cloneable interface {
// FactoryFunc for create event instance.
type FactoryFunc func() Event

// BasicEvent a basic event struct define.
// BasicEvent a built-in implements Event interface
type BasicEvent struct {
// event name
name string
Expand All @@ -99,6 +99,11 @@ type BasicEvent struct {
aborted bool
}

// New create an event instance
func New(name string, data M) *BasicEvent {
return NewBasic(name, data)
}

// NewBasic new a basic event instance
func NewBasic(name string, data M) *BasicEvent {
if data == nil {
Expand Down

0 comments on commit c020267

Please sign in to comment.