Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 11107

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Read a message from a queue without removing it from the queue.</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="samconnection.isconnected.html">SAMConnection::isConnected</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="samconnection.peekall.html">SAMConnection::peekAll</a></div>
 <div class="up"><a href="ref.sam.html">SAM Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="samconnection.peek" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">SAMConnection::peek</h1>
  <p class="verinfo">(PECL sam &gt;= 0.1.0)</p><p class="refpurpose"><span class="refname">SAMConnection::peek</span> &mdash; <span class="dc-title">
   Read a message from a queue without removing it from the queue.
  </span></p>

 </div>

 <div class="refsect1 description" id="refsect1-samconnection.peek-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type"><a href="ref.sam.html" class="type SAMMessage">SAMMessage</a></span> <span class="methodname"><strong>SAMConnection::peek</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$target</code></span>
   [, <span class="methodparam"><span class="type">array</span> <code class="parameter">$properties</code></span>
  ] )</div>

 </div>


 <div class="refsect1 parameters" id="refsect1-samconnection.peek-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    <dt>

     <span class="term"><em><code class="parameter">target</code></em></span>
     <dd>

      <p class="para">
       The identity of the queue from which to peek the message.
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">properties</code></em></span>
     <dd>

      <p class="para">
       An optional associative array of properties describing other
       parameters to control the peek operation.
       <table class="doctable informaltable">
        
         <thead>
          <tr>
           <th>Property name</th>
           <th>Possible values</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td>SAM_CORRELID</td>
           <td>
            This is the target correlation id string of the message. This
            would typically have been returned by a &quot;send&quot; request.
           </td>
          </tr>

          <tr>
           <td>SAM_MESSAGEID</td>
           <td>
            This is the message id string of the message which is to be
            peeked.
           </td>
          </tr>
             
         </tbody>
        
       </table>

      </p>
     </dd>

    </dt>

   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-samconnection.peek-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   This method returns a SAMMessage object or <strong><code>FALSE</code></strong> if an error occurs.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-samconnection.peek-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-4524">
    <p><strong>Example #1 Retrieve the next message from a queue without removing it</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$msg&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$conn</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">peek</span><span style="color: #007700">(</span><span style="color: #DD0000">'queue://receive/test'</span><span style="color: #007700">);<br /><br />if&nbsp;(!</span><span style="color: #0000BB">$msg</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;The&nbsp;peek&nbsp;failed!<br />&nbsp;&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">"Peek&nbsp;failed&nbsp;(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">errno</span><span style="color: #DD0000">)&nbsp;</span><span style="color: #0000BB">$conn</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">error</span><span style="color: #DD0000">"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
  <p class="para">
   <div class="example" id="example-4525">
    <p><strong>Example #2 Retrieve a specific message from a queue without removing it from the queue</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$msg&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$conn</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">peek</span><span style="color: #007700">(</span><span style="color: #DD0000">'queue://receive/test'</span><span style="color: #007700">,&nbsp;array(</span><span style="color: #0000BB">SAM_MESSAGEID&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$messageId</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-samconnection.peek-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><a href="samconnection.peekall.html" class="xref">SAMConnection::peekAll</a></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="samconnection.isconnected.html">SAMConnection::isConnected</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="samconnection.peekall.html">SAMConnection::peekAll</a></div>
 <div class="up"><a href="ref.sam.html">SAM Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>