PHP 클래스 Vinelab\Minion\Client

저자: Abed Halawi ([email protected])
상속: extends Thruway\Peer\Client
파일 보기 프로젝트 열기: vinelab/minion 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$delegateProvider Provider The delegate provider instance.
$topicPrefix string The prefix to use when generating topics/.

공개 메소드들

메소드 설명
__construct ( string $realm, array $providers ) Constructor.
call ( string $procedure, array $arguments = null, array $argumentsKw = null, array $options = null ) : Promise Call a registered procedure.
getDelegateProvider ( ) : Provider Get the delegate provider of this client.
getProviders ( ) : array Get the registered providers.
getTopicPrefix ( ) : string Get the topic prefix.
onSessionStart ( AbstractSession $session, Thruway\Transport\TransportInterface $transport ) Called when the server session has started which will call all the providers so that they perform whatever they have to do.
publish ( string $topic, array | mixed $arguments = null, array | mixed $argumentsKw = null, array $options = null ) : Promise Publish to a topic with the given data.
register ( string $topic, Closure $callback, array $options = null, boolean $isFunction = false ) : Promise Register a RPC.
setDelegateProvider ( Provider $provider ) Set the delegate provider of this client.
setTopicPrefix ( string $prefix ) Set the topic prefix.
start ( $debug = false, boolean $startLoop = true ) Start the transport.
subscribe ( string $topic, string | Closur\Closure $callback, array $options = null, boolean $isFunction = false ) : Promise Subscribe to a topic and specify a callback for it.
wrapWithProxy ( mixed $callback, boolean $isFunction = false ) : Closure Wrap the given callback with a proxy Closure.

보호된 메소드들

메소드 설명
prepareTopic ( string $topic ) : string Prepare the topic by prefixing it with @property $prefix as a convenience for having to manually prefix every topic.

비공개 메소드들

메소드 설명
bootProviders ( ) Boot up the registered providers by calling their boot() method.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( string $realm, array $providers )
$realm string
$providers array

call() 공개 메소드

Call a registered procedure.
public call ( string $procedure, array $arguments = null, array $argumentsKw = null, array $options = null ) : Promise
$procedure string
$arguments array
$argumentsKw array
$options array
리턴 React\Promise\Promise

getDelegateProvider() 공개 메소드

Get the delegate provider of this client.
public getDelegateProvider ( ) : Provider
리턴 Provider

getProviders() 공개 메소드

Get the registered providers.
public getProviders ( ) : array
리턴 array

getTopicPrefix() 공개 메소드

Get the topic prefix.
public getTopicPrefix ( ) : string
리턴 string

onSessionStart() 공개 메소드

Called when the server session has started which will call all the providers so that they perform whatever they have to do.
public onSessionStart ( AbstractSession $session, Thruway\Transport\TransportInterface $transport )
$session Thruway\AbstractSession
$transport Thruway\Transport\TransportInterface

prepareTopic() 보호된 메소드

Prepare the topic by prefixing it with @property $prefix as a convenience for having to manually prefix every topic.
protected prepareTopic ( string $topic ) : string
$topic string
리턴 string

publish() 공개 메소드

Publish to a topic with the given data.
public publish ( string $topic, array | mixed $arguments = null, array | mixed $argumentsKw = null, array $options = null ) : Promise
$topic string
$arguments array | mixed
$argumentsKw array | mixed
$options array
리턴 React\Promise\Promise

register() 공개 메소드

Register a RPC.
public register ( string $topic, Closure $callback, array $options = null, boolean $isFunction = false ) : Promise
$topic string
$callback Closure
$options array
$isFunction boolean
리턴 React\Promise\Promise

setDelegateProvider() 공개 메소드

Set the delegate provider of this client.
public setDelegateProvider ( Provider $provider )
$provider Provider

setTopicPrefix() 공개 메소드

Set the topic prefix.
public setTopicPrefix ( string $prefix )
$prefix string

start() 공개 메소드

Start the transport.
public start ( $debug = false, boolean $startLoop = true )
$startLoop boolean

subscribe() 공개 메소드

Subscribe to a topic and specify a callback for it.
또한 보기: Thruway\ClientSession::subscribe
public subscribe ( string $topic, string | Closur\Closure $callback, array $options = null, boolean $isFunction = false ) : Promise
$topic string The topic name.
$callback string | Closur\Closure The callable to be called when the topic received a publish.
$options array Will be passed straight to thruway @see \Thruway\ClientSession::subscribe
$isFunction boolean Specify whether you're passing in a function from a different scope, Set this to TRUE to avoid calling the passed callable from this provider's scope.
리턴 React\Promise\Promise

wrapWithProxy() 공개 메소드

The reason we use this is to be able to format the given $data into a Dictionary which makes it safer to work with them.
public wrapWithProxy ( mixed $callback, boolean $isFunction = false ) : Closure
$callback mixed
$isFunction boolean
리턴 Closure

프로퍼티 상세

$delegateProvider 보호되어 있는 프로퍼티

The delegate provider instance.
protected Provider,Vinelab\Minion $delegateProvider
리턴 Provider

$topicPrefix 보호되어 있는 프로퍼티

The prefix to use when generating topics/.
protected string $topicPrefix
리턴 string