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:
parent
ccdb886b9a
commit
047a288c38
4 changed files with 273 additions and 89 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue