CC-2588: Use RabbitMQ to control the show recorder

- recording works now.
- further testing is needed
- still need to work on canceling the show
This commit is contained in:
james 2011-07-23 12:30:36 -04:00
parent ccdb886b9a
commit 047a288c38
4 changed files with 273 additions and 89 deletions

View file

@ -37,6 +37,8 @@ class RabbitMq
$channel->basic_publish($msg, $EXCHANGE);
$channel->close();
$conn->close();
self::SendMessageToShowRecorder("update_schedule");
}
}
@ -63,5 +65,26 @@ class RabbitMq
$channel->close();
$conn->close();
}
public static function SendMessageToShowRecorder($event_type)
{
global $CC_CONFIG;
$conn = new AMQPConnection($CC_CONFIG["rabbitmq"]["host"],
$CC_CONFIG["rabbitmq"]["port"],
$CC_CONFIG["rabbitmq"]["user"],
$CC_CONFIG["rabbitmq"]["password"]);
$channel = $conn->channel();
$channel->access_request($CC_CONFIG["rabbitmq"]["vhost"], false, false, true, true);
$EXCHANGE = 'airtime-show-recorder';
$channel->exchange_declare($EXCHANGE, 'direct', false, true);
$msg = new AMQPMessage($event_type, array('content_type' => 'text/plain'));
$channel->basic_publish($msg, $EXCHANGE);
$channel->close();
$conn->close();
}
}