php-doc-en/reference/sam/functions/SAM-Connection-peek.xml
Dave Renshaw 8c6a1afe66 *** empty log message ***
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@224645 c90b9560-bf6c-de11-be94-00142212c4b1
2006-12-08 17:21:40 +00:00

129 lines
3.3 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<refentry id='function.SAM-Connection-peek'>
<refnamediv>
<refname>SAMConnection::peek()</refname>
<refpurpose>
Read a message from a queue without removing it from the queue.
</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<classsynopsis>
<ooclass><classname>SAMConnection</classname></ooclass>
<methodsynopsis>
<type>SAMMessage</type><methodname>peek</methodname>
<methodparam><type>string</type><parameter>target</parameter></methodparam>
<methodparam choice='opt'><type>array</type><parameter>properties</parameter></methodparam>
</methodsynopsis>
</classsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>target</parameter></term>
<listitem>
<para>
The identity of the queue from which to peek the message.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>properties</parameter></term>
<listitem>
<para>
An optional associative array of properties describing other parameters to control the peek operation.
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>Property name</entry>
<entry>Possible values</entry>
</row>
</thead>
<tbody>
<row>
<entry>SAM_CORRELID</entry>
<entry>This is the target correlation id string of the message. This would typically have been returned by a "send" request.</entry>
</row>
<row>
<entry>SAM_MESSAGEID</entry>
<entry>This is the message id string of the message which is to be peeked.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
This method returns a SAMMessage object or &false; if an error occurs.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Retrieve the next message from a queue without removing it</title>
<programlisting role="php">
<![CDATA[
<?php
$msg = $conn->peek('queue://receive/test');
if (!$msg) {
// The peek failed!
echo "Peek failed ($conn->errno) $conn->error";
}
?>
]]>
</programlisting>
</example>
</para>
<para>
<example>
<title>Retrieve a specific message from a queue without removing it from the queue</title>
<programlisting role="php">
<![CDATA[
<?php
$msg = $conn->peek('queue://receive/test', array(SAM_MESSAGEID => $messageId));
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->