public
Description: An Erlang client library for beanstalkd
Homepage: http://tfletcher.com/dev/erlang-beanstalk
Clone URL: git://github.com/tim/erlang-beanstalk.git
Use a tagged tuple to represent a job, instead of just a proplist.
tim (author)
Sun May 04 03:00:44 -0700 2008
commit  9e7e48927c88dd6d15e048b9dca9a5726901fc37
tree    2ccbad8b8a162e9255c8371090d4a89dbe56ece7
parent  f479ebbfd2bb68950a5e03f756726c94700607f2
...
34
35
36
37
 
38
39
 
40
41
42
 
43
44
45
 
 
46
47
48
 
 
49
50
51
 
 
52
53
54
 
 
55
56
57
 
 
58
59
60
 
 
...
34
35
36
 
37
38
 
39
40
41
 
42
43
 
 
44
45
46
 
 
47
48
49
 
 
50
51
52
 
 
53
54
55
 
 
56
57
58
 
 
59
60
0
@@ -34,27 +34,27 @@
0
 
0
 
0
 new(ID) when is_integer(ID) ->
0
- [{id, ID}];
0
+ {beanstalk_job, [{id, ID}]};
0
 new(Body) when is_list(Body); is_binary(Body) ->
0
- [{body, Body}].
0
+ {beanstalk_job, [{body, Body}]}.
0
 
0
 new(ID, Body) ->
0
- [{id, ID}, {body, Body}].
0
+ {beanstalk_job, [{id, ID}, {body, Body}]}.
0
 
0
-id(Job) ->
0
- proplists:get_value(id, Job).
0
+id({beanstalk_job, Attrs}) ->
0
+ proplists:get_value(id, Attrs).
0
 
0
-body(Job) ->
0
- proplists:get_value(body, Job).
0
+body({beanstalk_job, Attrs}) ->
0
+ proplists:get_value(body, Attrs).
0
 
0
-priority(Job) ->
0
- proplists:get_value(priority, Job, 0).
0
+priority({beanstalk_job, Attrs}) ->
0
+ proplists:get_value(priority, Attrs, 0).
0
 
0
-delay(Job) ->
0
- proplists:get_value(delay, Job, 0).
0
+delay({beanstalk_job, Attrs}) ->
0
+ proplists:get_value(delay, Attrs, 0).
0
 
0
-ttr(Job) ->
0
- proplists:get_value(ttr, Job, 60).
0
+ttr({beanstalk_job, Attrs}) ->
0
+ proplists:get_value(ttr, Attrs, 60).
0
 
0
-with(Key, Value, Job) ->
0
- [{Key, Value}|proplists:delete(Key, Job)].
0
+with(Key, Value, {beanstalk_job, Attrs}) ->
0
+ {beanstalk_job, [{Key, Value}|proplists:delete(Key, Attrs)]}.

Comments

    No one has commented yet.