Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R15 callbacks #10

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Implement jobs_queue_list:peek/1.
  • Loading branch information
jlouis committed Mar 3, 2012
commit ede8367fd9a88455de7cdcb34dbdd7ce3fe015cc
7 changes: 7 additions & 0 deletions src/jobs_queue_list.erl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
delete/1]).
-export([in/3,
out/2,
peek/1,
info/2,
all/1,
empty/1,
Expand Down Expand Up @@ -75,6 +76,12 @@ out(N, #queue{st = L, oldest_job = OJ} = Q) when N >= 0 ->
end,
{Out, Q#queue{st = Rest, oldest_job = OJ1}}.

peek(#queue { st = []}) ->
undefined;
peek(#queue { st = [H|_]}) ->
H.


split(N, L) ->
split(N, L, []).

Expand Down