本文整理汇总了C#中System.Threading.CancellationToken.RequestCanceled方法的典型用法代码示例。如果您正苦于以下问题:C# CancellationToken.RequestCanceled方法的具体用法?C# CancellationToken.RequestCanceled怎么用?C# CancellationToken.RequestCanceled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Threading.CancellationToken
的用法示例。
在下文中一共展示了CancellationToken.RequestCanceled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Get
public Task<Binding> Get(Action<QueueTarget> queue, Action<ExchangeTarget> exchange,
Action<VirtualHostTarget> virtualHost, Action<PropertiesKeyTarget> propertiesKey,
CancellationToken cancellationToken = default(CancellationToken))
{
cancellationToken.RequestCanceled(LogInfo);
var queueTargetImpl = new QueueTargetImpl();
queue(queueTargetImpl);
var virtualHostTargetImpl = new VirtualHostTargetImpl();
virtualHost(virtualHostTargetImpl);
var exchangeTargetImpl = new ExchangeTargetImpl();
exchange(exchangeTargetImpl);
var propertiesKeyTargetImpl = new PropertiesKeyTargetImpl();
propertiesKey(propertiesKeyTargetImpl);
string url = string.Format("api/bindings/{0}/e/{1}/q/{2}/{3}",
virtualHostTargetImpl.Target.SanitizeVirtualHostName(),
exchangeTargetImpl.Target, queueTargetImpl.Target,
propertiesKeyTargetImpl.Target.SanitizePropertiesKey());
LogInfo(
string.Format(
"Sent request to RabbitMQ server to return queue binding between queue '{0}' and exchange '{1}' in virtual host '{2}'.",
queueTargetImpl.Target, exchangeTargetImpl.Target, virtualHostTargetImpl.Target));
return base.Get(url, cancellationToken).As<Binding>(cancellationToken);
}
示例2: Delete
public Task<ServerResponse> Delete(string userName,
CancellationToken cancellationToken = default(CancellationToken))
{
cancellationToken.RequestCanceled(LogInfo);
string url = string.Format("api/permissions/{0}/{1}", Init.VirtualHost.SanitizeVirtualHostName(), userName);
return base.Delete(url, cancellationToken).Response<ServerResponse>(cancellationToken);
}
示例3: GetAll
public Task<IEnumerable<Connection>> GetAll(CancellationToken cancellationToken = default(CancellationToken))
{
cancellationToken.RequestCanceled(LogInfo);
LogInfo("Sent request to return all information pertaining to all connections on current RabbitMQ server.");
string url = "api/connections";
return base.Get(url, cancellationToken).As<IEnumerable<Connection>>(cancellationToken);
}
示例4: GetAll
public Task<IEnumerable<Node>> GetAll(CancellationToken cancellationToken = default(CancellationToken))
{
cancellationToken.RequestCanceled(LogInfo);
LogInfo("Sent request to return all information pertaining to all nodes on RabbitMQ cluster.");
string url = "api/nodes";
return base.Get(url, cancellationToken).As<IEnumerable<Node>>(cancellationToken);
}
示例5: Get
public Task<Node> Get(string nodeName, CancellationToken cancellationToken = default(CancellationToken))
{
cancellationToken.RequestCanceled(LogInfo);
LogInfo("Sent request to return all information pertaining to all nodes on RabbitMQ cluster.");
string url = string.Format("api/nodes/{0}", nodeName);
return base.Get(url, cancellationToken).As<Node>(cancellationToken);
}
示例6: Get
public Task<Overview> Get(CancellationToken cancellationToken = default(CancellationToken))
{
cancellationToken.RequestCanceled(LogInfo);
LogInfo("Sent request to return general information pertaining to current RabbitMQ server.");
string url = "api/overview";
return base.Get(url, cancellationToken).As<Overview>(cancellationToken);
}
示例7: GetAll
public Task<IEnumerable<Parameter>> GetAll(CancellationToken cancellationToken = default(CancellationToken))
{
cancellationToken.RequestCanceled(LogInfo);
LogInfo(
"Sent request to return all information pertaining to all parameters on all virtual hosts on current RabbitMQ server.");
string url = "api/parameters";
return base.Get(url, cancellationToken).As<IEnumerable<Parameter>>(cancellationToken);
}
示例8: Get
public Task<User> Get(string userName, CancellationToken cancellationToken = default(CancellationToken))
{
cancellationToken.RequestCanceled(LogInfo);
LogInfo(string.Format(
"Sent request to the RabbitMQ server to return information pertaining to user '{0}'.", userName));
string url = string.Format("api/users/{0}", userName);
return base.Get(url, cancellationToken).As<User>(cancellationToken);
}
示例9: Delete
public Task<ServerResponse> Delete(string policy,
CancellationToken cancellationToken = default(CancellationToken))
{
cancellationToken.RequestCanceled(LogInfo);
LogInfo(string.Format("Sent request to RabbitMQ server to delete policy '{0}' from virtual host '{1}'.",
policy, Init.VirtualHost));
string url = string.Format("api/policies/{0}/{1}", Init.VirtualHost.SanitizeVirtualHostName(), policy);
return base.Delete(url, cancellationToken).Response<ServerResponse>(cancellationToken);
}
示例10: Get
public Task<Permissions> Get(string userName, CancellationToken cancellationToken = default(CancellationToken))
{
cancellationToken.RequestCanceled(LogInfo);
string url = string.Format("api/permissions/{0}/{1}", Init.VirtualHost.SanitizeVirtualHostName(), userName);
LogInfo(
string.Format(
"Sent request to return user permission information pertaining to user '{0}' on virtual host '{1}' users on current RabbitMQ server.",
userName, Init.VirtualHost));
return base.Get(url, cancellationToken).As<Permissions>(cancellationToken);
}
示例11: Get
public Task<Channel> Get(string channelName, CancellationToken cancellationToken = default(CancellationToken))
{
cancellationToken.RequestCanceled(LogInfo);
string url = string.Format("api/channels/{0}", channelName);
LogInfo(
string.Format(
"Sent request to return all information pertaining to channel '{0}' on current RabbitMQ server.",
channelName));
return base.Get(url, cancellationToken).As<Channel>(cancellationToken);
}
示例12: Get
public Task<Exchange> Get(string exchange, CancellationToken cancellationToken = default(CancellationToken))
{
cancellationToken.RequestCanceled(LogInfo);
LogInfo(
string.Format(
"Sent request to RabbitMQ server to return information pertaining to exchange '{0}' belonging to virtual host '{1}'.",
exchange, Init.VirtualHost));
string url = string.Format("api/exchanges/{0}/{1}", Init.VirtualHost.SanitizeVirtualHostName(), exchange);
return base.Get(url, cancellationToken).As<Exchange>(cancellationToken);
}
示例13: Get
public Task<Policy> Get(string policy, Action<PolicyBehavior> args,
CancellationToken cancellationToken = default(CancellationToken))
{
cancellationToken.RequestCanceled(LogInfo);
LogInfo(
string.Format(
"Sent request to RabbitMQ server to return policy information pertaining to policy '{0}' belonging to virtual host '{1}'.",
policy, Init.VirtualHost));
string url = string.Format("api/policies/{0}/{1}", Init.VirtualHost.SanitizeVirtualHostName(), policy);
return base.Get(url, cancellationToken).As<Policy>(cancellationToken);
}
示例14: Close
public Task<ServerResponse> Close(string connectionName,
CancellationToken cancellationToken = default(CancellationToken))
{
cancellationToken.RequestCanceled(LogInfo);
string url = string.Format("api/connections/{0}", connectionName);
LogInfo(
string.Format(
"Sent request to return all information pertaining to connection '{0}' on current RabbitMQ server.",
connectionName));
return base.Delete(url, cancellationToken).Response<ServerResponse>(cancellationToken);
}
示例15: GetAll
public Task<IEnumerable<Binding>> GetAll(string queue,
CancellationToken cancellationToken = default(CancellationToken))
{
cancellationToken.RequestCanceled(LogInfo);
LogInfo(
string.Format(
"Sent request to RabbitMQ server to return all bindings on queue '{0}' belonging to virtual host '{1}'.",
queue, Init.VirtualHost));
string url = string.Format("api/queues/{0}/{1}/bindings", Init.VirtualHost.SanitizeVirtualHostName(), queue);
return base.Get(url, cancellationToken).As<IEnumerable<Binding>>(cancellationToken);
}