MessageProducer

Represents a stream of message that can be written to.

package

Default

Methods

__construct

__construct() 

address

address() : string

Response

string

The address to which the producer produces messages.

Closes the producer, this method should be called when the message producer is not used anymore.

close( $arg0 = null) : void

close()

Same as @see \io\vertx\jphp\core\eventbus\MessageProducer::close but with an handler called when the operation completes

param $handler [callable] close($handler)

Arguments

$arg0

callable

Update the delivery options of this producer.

deliveryOptions( $arg0) : $this

Arguments

$arg0

array | DeliveryOptions

Response

$this

this producer object

drainHandler

drainHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

Closes the producer, calls @see \io\vertx\jphp\core\eventbus\MessageProducer::close

end( $arg0 = null,  $arg1 = null) : void

end()

Same as @see \io\vertx\jphp\core\eventbus\MessageProducer::end but writes some data to the stream before ending.

param $data [mixed] the data to write end($data)

Closes the producer, calls @see \io\vertx\jphp\core\eventbus\MessageProducer::close

param $handler [callable] end($handler)

Same as but with an handler called when the operation completes

param $data [mixed] param $handler [callable] end($data, $handler)

Arguments

$arg0

callable | mixed

$arg1

callable

exceptionHandler

exceptionHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

This method actually sends a message using the send semantic regardless this producer is a sender or a publisher.

send( $arg0,  $arg1 = null) : \io\vertx\jphp\core\eventbus\MessageProducer<T>

param $message [mixed] the message to send this method is deprecated send($message)

Like @see \io\vertx\jphp\core\eventbus\MessageProducer::send but specifying a replyHandler that will be called if the recipient subsequently replies to the message.

param $message [mixed] the message to send param $replyHandler [callable] reply handler will be called when any reply from the recipient is received, may be {@code null} this method is deprecated send($message, $replyHandler)

deprecated

Arguments

$arg0

mixed

$arg1

callable

Response

\io\vertx\jphp\core\eventbus\MessageProducer

reference to this for fluency

setWriteQueueMaxSize

setWriteQueueMaxSize( $arg0) : $this

Arguments

$arg0

integer

Response

$this

param $data [mixed] <b> write($data) </b>

write( $arg0,  $arg1 = null) : $this

param $data [mixed] param $handler [callable] write($data, $handler)

Arguments

$arg0

mixed

$arg1

callable

Response

$this

This will return <code>true</code> if there are more bytes in the write queue than the value set using @see \io\vertx\jphp\core\eventbus\MessageProducer::setWriteQueueMaxSize

writeQueueFull() : boolean

Response

boolean

true if write queue is full

Constants

DEFAULT_WRITE_QUEUE_MAX_SIZE

DEFAULT_WRITE_QUEUE_MAX_SIZE
var

php文件只是为了写代码方便,常量的实际值请参考原java文件