Sends an acknowledgement back to the message broker so the message can be
removed from the queue.

@param $payload
The payload received in the consume callback.
484335
public function sendAck($payload)
    {

        if (empty($payload->delivery_info['delivery_tag'])) {
            throw new Exception('sendAck: delivery_tag not set.');
        }

        $payload->delivery_info['channel']->basic_ack($payload->delivery_info['delivery_tag']);
    }
174243
public static function process(array $payload, Parameters $parameters, LoggerInterface $logger) {

        try {

            $processor = new self($payload, $parameters, $logger);

            $return = $processor->run();

        } catch (RpcException $re) {

            throw $re;

        } catch (Exception $e) {

            throw $e;

        }

        return $return;

    }
524525
public function release($queue, $payload, $delay, $attempts)
	{
		$payload = $this->setMeta($payload, 'attempts', $attempts);

		$this->redis->zadd($this->getQueue($queue).':delayed', $this->getTime() + $delay, $payload);
	}
1262898
public function notify($event, $payload)
    {
        $result = null;

        foreach ($this->handlers as $condition => $handlers) {
            if ('*' === $condition || ($condition & $event) === $event) {
                foreach ($handlers as $handler) {
                    if ($clause = $this->clauses[spl_object_hash((object) $handler)] ?? null) {
                        if ($clause->intercepted($payload)) {
                            continue;
                        }
                    }
                    $response = $this->callHandler($handler, $payload);

                    switch (true) {
                        case $response instanceof TerminateResult:
                            return $response->content;
                        case true === $response:
                            continue 2;
                        case false === $response:
                            break 2;
                        case !empty($response) && !($result instanceof FinallyResult):
                            $result = $response;
                    }
                }
            }
        }

        return $result instanceof FinallyResult ? $result->content : $result;
    }
1059688
public function triggerEvent($event, Payload $payload)
    {
        if ($payload->state() === null) {
            $this->updatePayload($this->process->initialState(), $payload);
        }

        $state = $this->process->state($payload->state());

        $nextStateName = $state->triggerEvent($event, $payload);
        if ($nextStateName === null) {
            return;
        }

        $state = $this->process->state($nextStateName);

        $this->updatePayload($state, $payload);
        $this->handleOnStateWasSet($state, $payload);
    }
809678
protected function setMessagePayload(array $payload): void
    {
        $this->payloadOrigin = new ImmutableParameter($payload);
        $temp = [];

        foreach ($payload as $key => $value) {
            $property = $this->toCamelCase($key);

            if (property_exists($this, $property)) {
                $this->setPropValue($property, $value);
                $temp[$key] = $value;
            }
        }

        $this->payload = new ImmutableParameter($temp);
    }
827668
public function push($payload): void
    {
        // attach sender if not broadcast
        if (! $this->broadcast && $this->sender && ! $this->hasDescriptor($this->sender)) {
            $this->addDescriptor($this->sender);
        }

        // check if to broadcast to other clients
        if ($this->shouldBroadcast()) {
            $this->addDescriptors($this->getWebsocketConnections());
        }

        // push message to designated fds
        foreach ($this->descriptors as $descriptor) {
            if ($this->shouldPushToDescriptor($descriptor)) {
                $this->server->push($descriptor, $payload, $this->opcode);
            }
        }
    }
868125
public function push($event, $payload = array())
	{
		$this->listen($event.'_pushed', function() use ($event, $payload)
		{
			$this->fire($event, $payload);
		});
	}
921627
public static function createMessageReadEvent(array $payload)
    {
        $read = Read::create($payload['read']);
        $senderId = $payload['sender']['id'];
        $recipientId = $payload['recipient']['id'];
        $timestamp = $payload['timestamp'];

        return new MessageReadEvent($senderId, $recipientId, $timestamp, $read);
    }
985074
protected function handleCustomerSubscriptionDeleted(array $payload)
    {
        $user = $this->getUserByStripeId($payload['data']['object']['customer']);
        if ($user) {
            $subscriptions = $user->getSubscriptions()->all();
            /* @var $subscription SubscriptionModel */
            foreach ($subscriptions as $subscription) {
                if ($subscription->stripe_id === $payload['data']['object']['id']) {
                    $subscription->markAsCancelled();
                }
            }
        }

        return new Response([
            'statusCode' => 200,
            'statusText' => 'Webhook Handled',
        ]);
    }
902814
public function beingDeleted($payload)
    {
        $type = get_class($payload);
        $id = $payload->id;

        Translation::where('entity_id', $id)->where('entity_type', $type)->delete();
        Archive::where('entity_id', $id)->where('entity_type', $type)->delete();

        Archive::where('entity_type', 'Grafite\Cms\Models\Translation')
            ->where('entity_data', 'LIKE', '%"entity_id":'.$id.'%')
            ->where('entity_data', 'LIKE', '%"entity_type":"'.$type.'"%')
            ->delete();

        if ($type == 'Grafite\Cms\Models\Page') {
            Link::where('page_id', $id)->delete();
        }
    }
453546
public function addForever(Payload $payload)
    {
        $this->storage->forever($this->getKey($payload), 'forever');

        return true;
    }
1198439
final protected function applyChange(Serializable $payload)
    {
        $this->apply($payload);
        $this->changes()->addEventFromPayload($payload);
    }
805448
public function handle($event, $payload)
    {
        list($model) = $payload;
        
        if (!empty($model->locale)
            && empty($model->locale_group)
            && !is_a($model, Element::class) // Elements don't have groups
            && ($locales = Config::get('decoy.site.locales'))
            && count($locales) > 1) {
            $model->setAttribute('locale_group', Str::random());
        }
    }
1362732
public function packPayload($payload)
    {
        $payload = JsonEncoder::jsonEncode($payload);

        /** @var APNSMessage $message */
        $message = $this->message;

        $recipientId = $message->getRecipientDeviceCollection()->current()->getIdentifier();

        $messageRecipientId = $this->notificationId . '_' . $recipientId;

        $packedPayload =
            pack('C', 1). // Command push
            pack('N', $messageRecipientId).
            pack('N', $message->getExpirationTime()->format('U')).
            pack('n', 32). // Token binary length
            pack('H*', $recipientId);
        pack('n', strlen($payload));

        $packedPayload .= $payload;

        return $packedPayload;
    }
97734
public function publish($subject, $payload = null, $inbox = null)
    {
        $payload = $this->encoder->encode($payload);
        parent::publish($subject, $payload, $inbox);
    }
337237
final private function apply(Serializable $payload)
    {
        $method = $this->applyMethod($payload);
        $this->$method($payload);
    }