This repository has been archived by the owner on Apr 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Process.pid and Process.link methods, as well as some minor cleanups
- Loading branch information
Tony Arcieri
committed
Jul 1, 2010
1 parent
707902e
commit dd0b2a4
Showing
1 changed file
with
9 additions
and
5 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
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 |