summaryrefslogtreecommitdiff
path: root/app/Job/HttpAsyncJob.php
blob: 9e5cf107b88a060463e004479148c9aeb7708947 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php

namespace Kanboard\Job;

/**
 * Async HTTP Client (fire and forget)
 *
 * @package Kanboard\Job
 * @author  Frederic Guillot
 */
class HttpAsyncJob extends BaseJob
{
    /**
     * Set job parameters
     *
     * @access public
     * @param string $method
     * @param string $url
     * @param string $content
     * @param array  $headers
     * @return $this
     */
    public function withParams($method, $url, $content, array $headers)
    {
        $this->jobParams = array($method, $url, $content, $headers);
        return $this;
    }

    /**
     * Set job parameters
     *
     * @access public
     * @param string $method
     * @param string $url
     * @param string $content
     * @param array  $headers
     * @return $this
     */
    public function execute($method, $url, $content, array $headers)
    {
        $this->httpClient->doRequest($method, $url, $content, $headers);
    }
}