Fixed compilation issue due to recent changes in ChannelImpl
This commit is contained in:
parent
d3c0ea293b
commit
055431de6e
|
|
@ -213,26 +213,7 @@ public:
|
||||||
*
|
*
|
||||||
* @param callback the callback to execute
|
* @param callback the callback to execute
|
||||||
*/
|
*/
|
||||||
void onError(const ErrorCallback &callback)
|
void onError(const ErrorCallback &callback);
|
||||||
{
|
|
||||||
// store callback
|
|
||||||
_errorCallback = callback;
|
|
||||||
|
|
||||||
// if the channel is connected, all is ok
|
|
||||||
if (connected()) return;
|
|
||||||
|
|
||||||
// is the channel closing down?
|
|
||||||
if (_state == state_closing) return callback("Channel is closing down");
|
|
||||||
|
|
||||||
// the channel is closed, but what is the connection doing?
|
|
||||||
if (_connection == nullptr) return callback("Channel is not linked to a connection");
|
|
||||||
|
|
||||||
// if the connection is valid, this is a pure channel error
|
|
||||||
if (_connection->connected()) return callback("Channel is in an error state, but the connection is valid");
|
|
||||||
|
|
||||||
// direct call if channel is already in error state
|
|
||||||
callback("Channel is in error state because no AMQP connection is available");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pause deliveries on a channel
|
* Pause deliveries on a channel
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,35 @@ ChannelImpl::~ChannelImpl()
|
||||||
if (_connection) _connection->remove(this);
|
if (_connection) _connection->remove(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback that is called when an error occurs.
|
||||||
|
*
|
||||||
|
* Only one error callback can be registered. Calling this function
|
||||||
|
* multiple times will remove the old callback.
|
||||||
|
*
|
||||||
|
* @param callback the callback to execute
|
||||||
|
*/
|
||||||
|
void ChannelImpl::onError(const ErrorCallback &callback)
|
||||||
|
{
|
||||||
|
// store callback
|
||||||
|
_errorCallback = callback;
|
||||||
|
|
||||||
|
// if the channel is connected, all is ok
|
||||||
|
if (connected()) return;
|
||||||
|
|
||||||
|
// is the channel closing down?
|
||||||
|
if (_state == state_closing) return callback("Channel is closing down");
|
||||||
|
|
||||||
|
// the channel is closed, but what is the connection doing?
|
||||||
|
if (_connection == nullptr) return callback("Channel is not linked to a connection");
|
||||||
|
|
||||||
|
// if the connection is valid, this is a pure channel error
|
||||||
|
if (_connection->connected()) return callback("Channel is in an error state, but the connection is valid");
|
||||||
|
|
||||||
|
// direct call if channel is already in error state
|
||||||
|
callback("Channel is in error state because no AMQP connection is available");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the object with an connection
|
* Initialize the object with an connection
|
||||||
* @param connection
|
* @param connection
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue