PHP.mk документација

Stomp::__destruct

Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.

stomp.destruct.php PHP.net прокси Преводот се освежува
Оригинал на PHP.net
Патека stomp.destruct.php Локална патека за оваа страница.
Извор php.net/manual/en Оригиналниот HTML се реупотребува и локално се стилизира.
Режим Прокси + превод во позадина Кодовите, табелите и белешките остануваат читливи во истиот тек.
Stomp::__destruct

Референца за `stomp.destruct.php` со подобрена типографија и навигација.

stomp.destruct.php

Stomp::__destruct

stomp_close

(PECL stomp >= 0.1.0)

Stomp::__destruct -- stomp_closeCloses stomp connection

= NULL

Object-oriented style (destructor):

public Stomp::__destruct()

Објектно-ориентиран стил (метод):

stomp_close(resource $link): bool

Closes a previously opened connection.

Параметри

link

Регистрира слушање на дадена дестинација. stomp_connect().

Вратени вредности

Патеката до PHP скриптата што треба да се провери. true на успех или false при неуспех.

Примери

Константи за известување за грешки stomp_connect().

Белешки од корисници 2 забелешки

szasz dot attila at microsec dot hu
пред 1 година
Be careful, the lib does not send a DISCONNECT frame on destruction. Therefore the sessions will outlive the instance, accumulating in Artemis servers!
vanja at removethis dizyart period com
пред 7 години
Isn't it a little odd to have connect/disconnect in the constructor/destructor methods? 
I have a case where the connection is presumably kept alive until the PHP process ends:

<?php
class MyStompWrapper {
    public function doSend()
    {
        $stomp = $this->connect(); // returns Stomp Object
        $stomp->send('/destination', 'message', []);
        $this->disconnect($stomp);
        // $stomp still exists in this scope, hence, the connection is alive
    }

    private function disconnect(\Stomp $stompObj)
    {
        // only unsets the local $stomp pointer, does not actually disconnect
        unset($stomp);
    }

    private function connect():\Stomp
    {
        // try-catch block omitted for example brevity
        return new Stomp('url', 'username', 'password');
    }
}
?>

This means that, in order to handle disconnecting, I have to create and destroy the Stomp object within the same scope.
На оваа страница

Автоматски outline од активната документација.

Насловите ќе се појават тука по вчитување.

Попрегледно читање

Примерите, changelog табелите и user notes се визуелно издвоени за да не се губат во долгата содржина.

Брз совет Користи го outline-от Скокни директно на главните секции од активната страница.
Извор Оригиналниот линк останува достапен Кога ти треба целосен upstream context, отвори го PHP.net во нов tab.