Skip to content

Commit

Permalink
Removing useless comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinMontmirail committed Dec 29, 2023
1 parent 36b3574 commit d5d3e67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
6 changes: 3 additions & 3 deletions actor/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ type Context struct {
// It initializes a new context with a process identifier and an empty map for child processes.
func newContext(e *Engine, pid *PID) *Context {
return &Context{
engine: e, // Set the Engine reference.
pid: pid, // Set the process identifier.
children: safemap.New[string, *PID](), // Initialize an empty map for child PIDs.
engine: e,
pid: pid,
children: safemap.New[string, *PID](),
}
}

Expand Down
13 changes: 5 additions & 8 deletions actor/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,15 @@ type process struct {
// newProcess creates a new instance of a process.
// It initializes the process with the provided Engine and options.
func newProcess(e *Engine, opts Opts) *process {
// pid creates a new process identifier using Engine's address, the kind of the process, and its ID.
pid := NewPID(e.address, opts.Kind+pidSeparator+opts.ID)

pid := NewPID(e.address, opts.Kind+pidSeparator+opts.ID)
ctx := newContext(e, pid)

// p is a pointer to the new process being created with the specified pid, inbox, options, context, and message buffer.
p := &process{
pid: pid,
inbox: NewInbox(opts.InboxSize), // Initializes the inbox with the specified size from the options.
Opts: opts, // Sets the process options.
context: ctx, // Sets the process context.
mbuffer: nil, // Initializes the message buffer as nil.
inbox: NewInbox(opts.InboxSize),
Opts: opts,
context: ctx,
mbuffer: nil,
}

// Start the inbox to begin processing messages.
Expand Down

0 comments on commit d5d3e67

Please sign in to comment.