Hello
I think that most people people coming here are looking to do this on client side, in client/server web applications
Sam is not made for this, but to connect servers together - systems in fact. See http://project-sam.awardspace.com/overview.htm
Since PHP is stateless it is really hard to do collaborative applications with a PHP back-end and very few solutions exist. So, for those looking for this, I put here a link to a messaging server in PHP - free open source and community driven: http://php-polling.sourceforge.net/
Hoping this will make you save time!
Operaciones de mensajería
Todas las operaciones de mensajería se realizan a través de llamadas a métodos sobre el objeto de conexión. Para añadir un mensaje a una cola se utiliza en método "send" , para obtener un mensaje de una cola se utiliza el método "receive". Otros métodos proporcionan otras funcionalidades como la publicación, suscripción o el control sobre las transacciones.
Ejemplo #1 Añadir un mensaje a una cola y recibir una respuesta
<?php
$msg = new SAMMessage('Este es un mensaje simple de texto');
$msg->header->SAM_REPLY_TO = 'queue://receive/test';
$correlid = $conn->send('queue://send/test', $msg);
if (!$correlid) {
// El Send falló!
echo "Send fallido ($conn->errno) $conn->error";
} else {
$resp = $conn->receive('queue://receive/test', array(SAM_CORRELID => $correlid));
}
?>
a dot hoyau at silexlabs dot org ¶
1 year ago
