コード例 #1
0
        /// <summary>
        /// Delete an exchange
        /// </summary>
        /// <param name="bus">The bus instance</param>
        /// <param name="exchange">The exchange to delete</param>
        /// <param name="ifUnused">If set, the server will only delete the exchange if it has no queue bindings.</param>
        /// <param name="cancellationToken">The cancellation token</param>
        public static void ExchangeDelete(this IAdvancedBus bus, IExchange exchange, bool ifUnused = false, CancellationToken cancellationToken = default)
        {
            Preconditions.CheckNotNull(bus, "bus");

            bus.ExchangeDeleteAsync(exchange, ifUnused, cancellationToken)
            .GetAwaiter()
            .GetResult();
        }