public function sendMessage($phones, $content) { $client = new GearmanClient(); $client->addServer("219.232.243.98"); $client->setTimeout(2000); if ($client->timeout() > 2000) { return false; } $result = $client->doBackground("sendMessage", json_encode(array('content' => $content, 'phones' => $phones))); }
public function sendPasswordEmailGearman($id, $token, $email) { $client = new GearmanClient(); $client->addServer(); $client->setTimeout(2000); if ($client->timeout() > 2000) { return false; } $result = $client->doBackground("sendPasswordEmail", json_encode(array('id' => $id, 'email' => $email, 'token' => $token))); }