forked from JetBrains/phpstorm-stubs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
amqp.php
1240 lines (1115 loc) · 39.1 KB
/
amqp.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
* Stubs for AMQP
* https://pecl.php.net/package/amqp
* https://github.com/pdezwart/php-amqp
*/
/**
* Passing in this constant as a flag will forcefully disable all other flags.
* Use this if you want to temporarily disable the amqp.auto_ack ini setting.
*/
define('AMQP_NOPARAM', 0);
/**
* Durable exchanges and queues will survive a broker restart, complete with all of their data.
*/
define('AMQP_DURABLE', 2);
/**
* Passive exchanges and queues will not be redeclared, but the broker will throw an error if the exchange or queue does not exist.
*/
define('AMQP_PASSIVE', 4);
/**
* Valid for queues only, this flag indicates that only one client can be listening to and consuming from this queue.
*/
define('AMQP_EXCLUSIVE', 8);
/**
* For exchanges, the auto delete flag indicates that the exchange will be deleted as soon as no more queues are bound
* to it. If no queues were ever bound the exchange, the exchange will never be deleted. For queues, the auto delete
* flag indicates that the queue will be deleted as soon as there are no more listeners subscribed to it. If no
* subscription has ever been active, the queue will never be deleted. Note: Exclusive queues will always be
* automatically deleted with the client disconnects.
*/
define('AMQP_AUTODELETE', 16);
/**
* Clients are not allowed to make specific queue bindings to exchanges defined with this flag.
*/
define('AMQP_INTERNAL', 32);
/**
* When passed to the consume method for a clustered environment, do not consume from the local node.
*/
define('AMQP_NOLOCAL', 64);
/**
* When passed to the {@link AMQPQueue::get()} and {@link AMQPQueue::consume()} methods as a flag,
* the messages will be immediately marked as acknowledged by the server upon delivery.
*/
define('AMQP_AUTOACK', 128);
/**
* Passed on queue creation, this flag indicates that the queue should be deleted if it becomes empty.
*/
define('AMQP_IFEMPTY', 256);
/**
* Passed on queue or exchange creation, this flag indicates that the queue or exchange should be
* deleted when no clients are connected to the given queue or exchange.
*/
define('AMQP_IFUNUSED', 512);
/**
* When publishing a message, the message must be routed to a valid queue. If it is not, an error will be returned.
*/
define('AMQP_MANDATORY', 1024);
/**
* When publishing a message, mark this message for immediate processing by the broker. (High priority message.)
*/
define('AMQP_IMMEDIATE', 2048);
/**
* If set during a call to {@link AMQPQueue::ack()}, the delivery tag is treated as "up to and including", so that multiple
* messages can be acknowledged with a single method. If set to zero, the delivery tag refers to a single message.
* If the AMQP_MULTIPLE flag is set, and the delivery tag is zero, this indicates acknowledgement of all outstanding
* messages.
*/
define('AMQP_MULTIPLE', 4096);
/**
* If set during a call to {@link AMQPExchange::bind()}, the server will not respond to the method.The client should not wait
* for a reply method. If the server could not complete the method it will raise a channel or connection exception.
*/
define('AMQP_NOWAIT', 8192);
/**
* If set during a call to {@link AMQPQueue::nack()}, the message will be placed back to the queue.
*/
define('AMQP_REQUEUE', 16384);
/**
* A direct exchange type.
*/
define('AMQP_EX_TYPE_DIRECT', 'direct');
/**
* A fanout exchange type.
*/
define('AMQP_EX_TYPE_FANOUT', 'fanout');
/**
* A topic exchange type.
*/
define('AMQP_EX_TYPE_TOPIC', 'topic');
/**
* A header exchange type.
*/
define('AMQP_EX_TYPE_HEADERS', 'headers');
/**
*
*/
define('AMQP_OS_SOCKET_TIMEOUT_ERRNO', 536870947);
/**
*
*/
define('PHP_AMQP_MAX_CHANNELS', 256);
/**
* Represents a AMQP channel between PHP and a AMQP server.
* @link https://github.com/pdezwart/php-amqp/blob/master/amqp_channel.h
*/
class AMQPChannel
{
/**
* Create an instance of an AMQPChannel object.
*
* @param AMQPConnection $amqp_connection An instance of AMQPConnection
* with an active connection to a
* broker.
*
* @throws AMQPConnectionException If the connection to the broker
* was lost.
*/
public function __construct(AMQPConnection $amqp_connection) { }
/**
* Check the channel connection.
*
* @return bool Indicates whether the channel is connected.
*/
public function isConnected() { }
/**
* Return internal channel ID
*
* @return integer
*/
public function getChannelId() { }
/**
* Set the window size to prefetch from the broker.
*
* Set the prefetch window size, in octets, during a call to
* AMQPQueue::consume() or AMQPQueue::get(). Any call to this method will
* automatically set the prefetch message count to 0, meaning that the
* prefetch message count setting will be ignored. If the call to either
* AMQPQueue::consume() or AMQPQueue::get() is done with the AMQP_AUTOACK
* flag set, this setting will be ignored.
*
* @param integer $size The window size, in octets, to prefetch.
*
* @throws AMQPConnectionException If the connection to the broker was lost.
*
* @return bool TRUE on success or FALSE on failure.
*/
public function setPrefetchSize($size) { }
/**
* Get the window size to prefetch from the broker.
*
* @return integer
*/
public function getPrefetchSize() { }
/**
* Set the number of messages to prefetch from the broker.
*
* Set the number of messages to prefetch from the broker during a call to
* AMQPQueue::consume() or AMQPQueue::get(). Any call to this method will
* automatically set the prefetch window size to 0, meaning that the
* prefetch window size setting will be ignored.
*
* @param integer $count The number of messages to prefetch.
*
* @throws AMQPConnectionException If the connection to the broker was lost.
*
* @return boolean TRUE on success or FALSE on failure.
*/
public function setPrefetchCount($count) { }
/**
* Get the number of messages to prefetch from the broker.
*
* @return integer
*/
public function getPrefetchCount() { }
/**
* Set the Quality Of Service settings for the given channel.
*
* Specify the amount of data to prefetch in terms of window size (octets)
* or number of messages from a queue during a AMQPQueue::consume() or
* AMQPQueue::get() method call. The client will prefetch data up to size
* octets or count messages from the server, whichever limit is hit first.
* Setting either value to 0 will instruct the client to ignore that
* particular setting. A call to AMQPChannel::qos() will overwrite any
* values set by calling AMQPChannel::setPrefetchSize() and
* AMQPChannel::setPrefetchCount(). If the call to either
* AMQPQueue::consume() or AMQPQueue::get() is done with the AMQP_AUTOACK
* flag set, the client will not do any prefetching of data, regardless of
* the QOS settings.
*
* @param integer $size The window size, in octets, to prefetch.
* @param integer $count The number of messages to prefetch.
*
* @throws AMQPConnectionException If the connection to the broker was lost.
*
* @return bool TRUE on success or FALSE on failure.
*/
public function qos($size, $count) { }
/**
* Start a transaction.
*
* This method must be called on the given channel prior to calling
* AMQPChannel::commitTransaction() or AMQPChannel::rollbackTransaction().
*
* @throws AMQPConnectionException If the connection to the broker was lost.
*
* @return bool TRUE on success or FALSE on failure.
*/
public function startTransaction() { }
/**
* Commit a pending transaction.
*
* @throws AMQPChannelException If no transaction was started prior to
* calling this method.
* @throws AMQPConnectionException If the connection to the broker was lost.
*
* @return bool TRUE on success or FALSE on failure.
*/
public function commitTransaction() { }
/**
* Rollback a transaction.
*
* Rollback an existing transaction. AMQPChannel::startTransaction() must
* be called prior to this.
*
* @throws AMQPChannelException If no transaction was started prior to
* calling this method.
* @throws AMQPConnectionException If the connection to the broker was lost.
*
* @return bool TRUE on success or FALSE on failure.
*/
public function rollbackTransaction() { }
/**
* Get the AMQPConnection object in use
*
* @return AMQPConnection
*/
public function getConnection() { }
/**
* Redeliver unacknowledged messages.
*
* @param bool $requeue
*/
public function basicRecover($requeue = true) { }
}
class AMQPChannelException extends AMQPException
{
}
/**
* Represents a AMQP connection between PHP and a AMQP server.
* @link https://github.com/pdezwart/php-amqp/blob/master/amqp_connection.h
*/
class AMQPConnection
{
/**
* Create an instance of AMQPConnection.
*
* Creates an AMQPConnection instance representing a connection to an AMQP
* broker. A connection will not be established until
* AMQPConnection::connect() is called.
*
* $credentials = array(
* 'host' => amqp.host The host to connect too. Note: Max 1024 characters.
* 'port' => amqp.port Port on the host.
* 'vhost' => amqp.vhost The virtual host on the host. Note: Max 128 characters.
* 'login' => amqp.login The login name to use. Note: Max 128 characters.
* 'password' => amqp.password Password. Note: Max 128 characters.
* 'read_timeout' => Timeout in for income activity. Note: 0 or greater seconds. May be fractional.
* 'write_timeout' => Timeout in for outcome activity. Note: 0 or greater seconds. May be fractional.
* 'connect_timeout' => Connection timeout. Note: 0 or greater seconds. May be fractional.
* )
*
* @param array $credentials Optional array of credential information for
* connecting to the AMQP broker.
*/
public function __construct(array $credentials = array()) { }
/**
* Check whether the connection to the AMQP broker is still valid.
*
* It does so by checking the return status of the last connect-command.
*
* @return boolean True if connected, false otherwise.
*/
public function isConnected() { }
/**
* Establish a transient connection with the AMQP broker.
*
* This method will initiate a connection with the AMQP broker.
*
* @throws AMQPConnectionException
* @return boolean TRUE on success or throw an exception on failure.
*/
public function connect() { }
/**
* Establish a persistent connection with the AMQP broker.
*
* This method will initiate a connection with the AMQP broker
* or reuse an existing one if present.
*
* @throws AMQPConnectionException
* @return boolean TRUE on success or throws an exception on failure.
*/
public function pconnect() { }
/**
* Closes a persistent connection with the AMQP broker.
*
* This method will close an open persistent connection with the AMQP
* broker.
*
* @return boolean true if connection was found and closed,
* false if no persistent connection with this host,
* port, vhost and login could be found,
*/
public function pdisconnect() { }
/**
* Closes the transient connection with the AMQP broker.
*
* This method will close an open connection with the AMQP broker.
*
* @return boolean true if connection was successfully closed, false otherwise.
*/
public function disconnect() { }
/**
* Close any open transient connections and initiate a new one with the AMQP broker.
*
* @return boolean TRUE on success or FALSE on failure.
*/
public function reconnect() { }
/**
* Close any open persistent connections and initiate a new one with the AMQP broker.
*
* @return boolean TRUE on success or FALSE on failure.
*/
public function preconnect() { }
/**
* Get the configured login.
*
* @return string The configured login as a string.
*/
public function getLogin() { }
/**
* Set the login string used to connect to the AMQP broker.
*
* @param string $login The login string used to authenticate
* with the AMQP broker.
*
* @throws AMQPConnectionException If login is longer then 32 characters.
*
* @return boolean TRUE on success or FALSE on failure.
*/
public function setLogin($login) { }
/**
* Get the configured password.
*
* @return string The configured password as a string.
*/
public function getPassword() { }
/**
* Set the password string used to connect to the AMQP broker.
*
* @param string $password The password string used to authenticate
* with the AMQP broker.
*
* @throws AMQPConnectionException If password is longer then 32characters.
*
* @return boolean TRUE on success or FALSE on failure.
*/
public function setPassword($password) { }
/**
* Get the configured host.
*
* @return string The configured hostname of the broker
*/
public function getHost() { }
/**
* Set the hostname used to connect to the AMQP broker.
*
* @param string $host The hostname of the AMQP broker.
*
* @throws AMQPConnectionException If host is longer then 1024 characters.
*
* @return boolean TRUE on success or FALSE on failure.
*/
public function setHost($host) { }
/**
* Get the configured port.
*
* @return int The configured port as an integer.
*/
public function getPort() { }
/**
* Set the port used to connect to the AMQP broker.
*
* @param integer $port The port used to connect to the AMQP broker.
*
* @throws AMQPConnectionException If port is longer not between
* 1 and 65535.
*
* @return boolean TRUE on success or FALSE on failure.
*/
public function setPort($port) { }
/**
* Get the configured vhost.
*
* @return string The configured virtual host as a string.
*/
public function getVhost() { }
/**
* Sets the virtual host to which to connect on the AMQP broker.
*
* @param string $vhost The virtual host to use on the AMQP
* broker.
*
* @throws AMQPConnectionException If host is longer then 32 characters.
*
* @return boolean true on success or false on failure.
*/
public function setVhost($vhost) { }
/**
* Get the configured interval of time to wait for income activity
* from AMQP broker
*
* @deprecated use AMQPConnection::getReadTimout() instead
*
* @return float
*/
public function getTimeout() { }
/**
* Sets the interval of time to wait for income activity from AMQP broker
*
* @deprecated use AMQPConnection::setReadTimout($timeout) instead
*
* @param int $timeout
*
* @return bool
*/
public function setTimeout($timeout) { }
/**
* Get the configured interval of time to wait for income activity
* from AMQP broker
*
* @return float
*/
public function getReadTimeout() { }
/**
* Sets the interval of time to wait for income activity from AMQP broker
*
* @param int $timeout
*
* @return bool
*/
public function setReadTimeout($timeout) { }
/**
* Get the configured interval of time to wait for outcome activity
* to AMQP broker
*
* @return float
*/
public function getWriteTimeout() { }
/**
* Sets the interval of time to wait for outcome activity to AMQP broker
*
* @param int $timeout
*
* @return bool
*/
public function setWriteTimeout($timeout) { }
/**
* Return last used channel id during current connection session.
*
* @return int
*/
public function getUsedChannels() { }
/**
* Get the maximum number of channels the connection can handle.
*
* @return int|null
*/
public function getMaxChannels() { }
/**
* Whether connection persistent.
*
* @return bool|null
*/
public function isPersistent() { }
}
class AMQPConnectionException extends AMQPException
{
}
/**
* Represents a AMQP envelope
* @link https://github.com/pdezwart/php-amqp/blob/master/amqp_envelope.h
*/
class AMQPEnvelope
{
/**
* Get the body of the message.
*
* @return string The contents of the message body.
*/
public function getBody() { }
/**
* Get the routing key of the message.
*
* @return string The message routing key.
*/
public function getRoutingKey() { }
/**
* Get the delivery tag of the message.
*
* @return string The delivery tag of the message.
*/
public function getDeliveryTag() { }
/**
* Get the delivery mode of the message.
*
* @return integer The delivery mode of the message.
*/
public function getDeliveryMode() { }
/**
* Get the exchange name on which the message was published.
*
* @return string The exchange name on which the message was published.
*/
public function getExchangeName() { }
/**
* Whether this is a redelivery of the message.
*
* Whether this is a redelivery of a message. If this message has been
* delivered and AMQPEnvelope::nack() was called, the message will be put
* back on the queue to be redelivered, at which point the message will
* always return TRUE when this method is called.
*
* @return bool TRUE if this is a redelivery, FALSE otherwise.
*/
public function isRedelivery() { }
/**
* Get the message content type.
*
* @return string The content type of the message.
*/
public function getContentType() { }
/**
* Get the content encoding of the message.
*
* @return string The content encoding of the message.
*/
public function getContentEncoding() { }
/**
* Get the message type.
*
* @return string The message type.
*/
public function getType() { }
/**
* Get the timestamp of the message.
*
* @return string The message timestamp.
*/
public function getTimeStamp() { }
/**
* Get the priority of the message.
*
* @return int The message priority.
*/
public function getPriority() { }
/**
* Get the expiration of the message.
*
* @return string The message expiration.
*/
public function getExpiration() { }
/**
* Get the message user id.
*
* @return string The message user id.
*/
public function getUserId() { }
/**
* Get the application id of the message.
*
* @return string The application id of the message.
*/
public function getAppId() { }
/**
* Get the message id of the message.
*
* @return string The message id
*/
public function getMessageId() { }
/**
* Get the reply-to address of the message.
*
* @return string The contents of the reply to field.
*/
public function getReplyTo() { }
/**
* Get the message correlation id.
*
* @return string The correlation id of the message.
*/
public function getCorrelationId() { }
/**
* Get the headers of the message.
*
* @return array An array of key value pairs associated with the message.
*/
public function getHeaders() { }
/**
* Get a specific message header.
*
* @param string $header_key Name of the header to get the value from.
*
* @return string|boolean The contents of the specified header or FALSE
* if not set.
*/
public function getHeader($header_key) { }
}
class AMQPException extends Exception
{
}
/**
* Represents a AMQP exchange
* @link https://github.com/pdezwart/php-amqp/blob/master/amqp_exchange.h
*/
class AMQPExchange
{
/**
* Create an instance of AMQPExchange.
*
* Returns a new instance of an AMQPExchange object, associated with the
* given AMQPChannel object.
*
* @param AMQPChannel $amqp_channel A valid AMQPChannel object, connected
* to a broker.
*
* @throws AMQPExchangeException When amqp_channel is not connected to
* a broker.
* @throws AMQPConnectionException If the connection to the broker was
* lost.
*/
public function __construct(AMQPChannel $amqp_channel) { }
/**
* Get the configured name.
*
* @return string The configured name as a string.
*/
public function getName() { }
/**
* Set the name of the exchange.
*
* @param string $exchange_name The name of the exchange to set as string.
*
* @return boolean TRUE on success or FALSE on failure.
*/
public function setName($exchange_name) { }
/**
* Get the configured type.
*
* @return string The configured type as a string.
*/
public function getType() { }
/**
* Set the type of the exchange.
*
* Set the type of the exchange. This can be any of AMQP_EX_TYPE_DIRECT,
* AMQP_EX_TYPE_FANOUT, AMQP_EX_TYPE_HEADERS or AMQP_EX_TYPE_TOPIC.
*
* @param string $exchange_type The type of exchange as a string.
*
* @return boolean TRUE on success or FALSE on failure.
*/
public function setType($exchange_type) { }
/**
* Get all the flags currently set on the given exchange.
*
* @return int An integer bitmask of all the flags currently set on this
* exchange object.
*/
public function getFlags() { }
/**
* Set the flags on an exchange.
*
* @param integer $flags A bitmask of flags. This call currently only
* considers the following flags:
* AMQP_DURABLE, AMQP_PASSIVE
* (and AMQP_DURABLE, if librabbitmq version >= 0.5.3)
*
* @return boolean True on success or false on failure.
*/
public function setFlags($flags) { }
/**
* Get the argument associated with the given key.
*
* @param string $key The key to look up.
*
* @return string|integer|boolean The string or integer value associated
* with the given key, or FALSE if the key
* is not set.
*/
public function getArgument($key) { }
/**
* Get all arguments set on the given exchange.
*
* @return array An array containing all of the set key/value pairs.
*/
public function getArguments() { }
/**
* Set the value for the given key.
*
* @param string $key Name of the argument to set.
* @param string|integer $value Value of the argument to set.
*
* @return boolean TRUE on success or FALSE on failure.
*/
public function setArgument($key, $value) { }
/**
* Set all arguments on the exchange.
*
* @param array $arguments An array of key/value pairs of arguments.
*
* @return boolean TRUE on success or FALSE on failure.
*/
public function setArguments(array $arguments) { }
/**
* Declare a new exchange on the broker.
*
* @throws AMQPExchangeException On failure.
* @throws AMQPChannelException If the channel is not open.
* @throws AMQPConnectionException If the connection to the broker was lost.
*
* @return boolean TRUE on success or FALSE on failure.
*/
public function declareExchange() { }
/**
* Delete the exchange from the broker.
*
* @param string $exchangeName Optional name of exchange to delete.
* @param integer $flags Optionally AMQP_IFUNUSED can be specified
* to indicate the exchange should not be
* deleted until no clients are connected to
* it.
*
* @throws AMQPExchangeException On failure.
* @throws AMQPChannelException If the channel is not open.
* @throws AMQPConnectionException If the connection to the broker was lost.
*
* @return boolean true on success or false on failure.
*/
public function delete($exchangeName = null, $flags = AMQP_NOPARAM) { }
/**
* Bind to another exchange.
*
* Bind an exchange to another exchange using the specified routing key.
*
* @param string $exchange_name Name of the exchange to bind.
* @param string $routing_key The routing key to use for binding.
* @param array $arguments Additional binding arguments.
*
* @throws AMQPExchangeException On failure.
* @throws AMQPChannelException If the channel is not open.
* @throws AMQPConnectionException If the connection to the broker was lost.
* @return boolean true on success or false on failure.
*/
public function bind($exchange_name, $routing_key = '', array $arguments = array()) { }
/**
* Remove binding to another exchange.
*
* Remove a routing key binding on an another exchange from the given exchange.
*
* @param string $exchange_name Name of the exchange to bind.
* @param string $routing_key The routing key to use for binding.
* @param array $arguments Additional binding arguments.
*
* @throws AMQPExchangeException On failure.
* @throws AMQPChannelException If the channel is not open.
* @throws AMQPConnectionException If the connection to the broker was lost.
* @return boolean true on success or false on failure.
*/
public function unbind($exchange_name, $routing_key = '', array $arguments = array()) { }
/**
* Publish a message to an exchange.
*
* Publish a message to the exchange represented by the AMQPExchange object.
*
* @param string $message The message to publish.
* @param string $routing_key The optional routing key to which to
* publish to.
* @param integer $flags One or more of AMQP_MANDATORY and
* AMQP_IMMEDIATE.
* @param array $attributes One of content_type, content_encoding,
* message_id, user_id, app_id, delivery_mode,
* priority, timestamp, expiration, type
* or reply_to, headers.
*
* @throws AMQPExchangeException On failure.
* @throws AMQPChannelException If the channel is not open.
* @throws AMQPConnectionException If the connection to the broker was lost.
*
* @return boolean TRUE on success or FALSE on failure.
*/
public function publish(
$message,
$routing_key = null,
$flags = AMQP_NOPARAM,
array $attributes = array()
) {
}
/**
* Get the AMQPChannel object in use
*
* @return AMQPChannel
*/
public function getChannel() { }
/**
* Get the AMQPConnection object in use
*
* @return AMQPConnection
*/
public function getConnection() { }
}
class AMQPExchangeException extends AMQPException
{
}
/**
* Represents a AMQP queue
* @link https://github.com/pdezwart/php-amqp/blob/master/amqp_queue.h
*/
class AMQPQueue
{
/**
* Create an instance of an AMQPQueue object.
*
* @param AMQPChannel $amqp_channel The amqp channel to use.
*
* @throws AMQPQueueException When amqp_channel is not connected to a
* broker.
* @throws AMQPConnectionException If the connection to the broker was lost.
*/
public function __construct(AMQPChannel $amqp_channel) { }
/**
* Get the configured name.
*
* @return string The configured name as a string.
*/
public function getName() { }
/**
* Set the queue name.
*
* @param string $queue_name The name of the queue.
*
* @return boolean
*/
public function setName($queue_name) { }
/**
* Get all the flags currently set on the given queue.
*
* @return int An integer bitmask of all the flags currently set on this
* exchange object.
*/
public function getFlags() { }
/**
* Set the flags on the queue.
*
* @param integer $flags A bitmask of flags:
* AMQP_DURABLE, AMQP_PASSIVE,
* AMQP_EXCLUSIVE, AMQP_AUTODELETE.
*
* @return boolean
*/
public function setFlags($flags) { }
/**
* Get the argument associated with the given key.
*
* @param string $key The key to look up.
*
* @return string|integer|boolean The string or integer value associated
* with the given key, or false if the key
* is not set.
*/
public function getArgument($key) { }
/**
* Get all set arguments as an array of key/value pairs.
*
* @return array An array containing all of the set key/value pairs.
*/
public function getArguments() { }
/**
* Set a queue argument.
*
* @param string $key The key to set.