Skip to content
This repository has been archived by the owner on Apr 12, 2019. It is now read-only.

Commit

Permalink
Process.pid and Process.link methods, as well as some minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Arcieri committed Jul 1, 2010
1 parent 707902e commit dd0b2a4
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/process.re
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
#
# Process: lightweight shared-nothing processes
# process.re: lightweight shared-nothing processes
# Copyright (C)2008-10 Tony Arcieri
#
# Redistribution is permitted under the MIT license. See LICENSE for details.
#

module Process
# Process#spawn
# Create a new process
# Create a new process
def spawn(&block)
erl.proc_lib.spawn(block)
end

# Process#spawn_link
# Create a new process and links it to the current one
# Create a new process and links it to the current one
def spawn_link(&block)
erl.proc_lib.spawn_link(block)
end

# Retrieve the PID of the current process
def pid; erl.self(); end

# Link to another process
def link(pid); erl.link(pid); end
end

0 comments on commit dd0b2a4

Please sign in to comment.