@@ -77,9 +77,15 @@ public function size($queue = null)
7777 */
7878 public function push ($ job , $ data = '' , $ queue = null )
7979 {
80- return $ this ->enqueueUsing ($ job , function () use ($ job , $ data , $ queue ) {
81- return $ this ->pushRaw ($ this ->createPayload ($ job , $ this ->getQueue ($ queue ), $ data ), $ queue );
82- });
80+ return $ this ->enqueueUsing (
81+ $ job ,
82+ $ this ->createPayload ($ job , $ this ->getQueue ($ queue ), $ data ),
83+ $ queue ,
84+ null ,
85+ function ($ payload , $ queue ) {
86+ return $ this ->pushRaw ($ payload , $ queue );
87+ }
88+ );
8389 }
8490
8591 /**
@@ -108,16 +114,20 @@ public function pushRaw($payload, $queue = null, array $options = [])
108114 */
109115 public function later ($ delay , $ job , $ data = '' , $ queue = null )
110116 {
111- $ pheanstalk = $ this ->pheanstalk ->useTube ($ this ->getQueue ($ queue ));
112-
113- return $ this ->enqueueUsing ($ job , function () use ($ delay , $ pheanstalk , $ job , $ data , $ queue ) {
114- return $ pheanstalk ->put (
115- $ this ->createPayload ($ job , $ this ->getQueue ($ queue ), $ data ),
116- Pheanstalk::DEFAULT_PRIORITY ,
117- $ this ->secondsUntil ($ delay ),
118- $ this ->timeToRun
119- );
120- });
117+ return $ this ->enqueueUsing (
118+ $ job ,
119+ $ this ->createPayload ($ job , $ this ->getQueue ($ queue ), $ data ),
120+ $ queue ,
121+ $ delay ,
122+ function ($ payload , $ queue , $ delay ) {
123+ return $ this ->pheanstalk ->useTube ($ this ->getQueue ($ queue ))->put (
124+ $ payload ,
125+ Pheanstalk::DEFAULT_PRIORITY ,
126+ $ this ->secondsUntil ($ delay ),
127+ $ this ->timeToRun
128+ );
129+ }
130+ );
121131 }
122132
123133 /**
0 commit comments