本文整理汇总了Java中ratpack.exec.Blocking类的典型用法代码示例。如果您正苦于以下问题:Java Blocking类的具体用法?Java Blocking怎么用?Java Blocking使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Blocking类属于ratpack.exec包,在下文中一共展示了Blocking类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handle
import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
public void handle(Context context) throws Exception {
try {
Blocking.get(
() -> config.authenticate(injector, config.getInput(context))
).onError(t -> {
if (t.getClass().equals(AuthenticationFailed.class)) {
AuthenticationFailed failure = (AuthenticationFailed) t;
context.getResponse().status(failure.getHttpStatus()).send(failure.getMessage());
}
}).then(claims -> {
String token = jwtSigner.sign(claims.toMap());
context.render(Jackson.json(token));
});
} catch (ParserException e) {
LOGGER.info("Failed to parse Credential", e);
context.getResponse().status(400).send();
}
}
示例2: backoff
import ratpack.exec.Blocking; //导入依赖的package包/类
public Promise<Void> backoff() {
return Blocking.op(() -> {
log.debug("Circuit is OPEN. Waiting...");
Thread.sleep(waitTime());
mark();
}).promise();
}
示例3: awaitShutdown
import ratpack.exec.Blocking; //导入依赖的package包/类
private Operation awaitShutdown() {
return Blocking.op(() -> {
synchronized (mutex) {
try {
mutex.wait();
} catch (InterruptedException e) {
//Intentionally left blank
}
}
});
}
示例4: createTopic
import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<CreateTopicResult> createTopic(CreateTopicRequest request) {
LOG.trace("creating sns topic request={}", request);
return Blocking.get(() -> sns().createTopic(request))
.transform(breaker);
}
示例5: subscribe
import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<SubscribeResult> subscribe(SubscribeRequest request) {
LOG.trace("subscribing to sns topic request={}", request);
return Blocking.get(() -> sns().subscribe(request))
.transform(breaker);
}
示例6: publish
import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<PublishResult> publish(PublishRequest request) {
LOG.trace("publishing to sns topic request={}", request);
return Blocking.get(() -> sns().publish(request))
.transform(breaker);
}
示例7: deleteTopic
import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<DeleteTopicResult> deleteTopic(DeleteTopicRequest request) {
LOG.debug("deleting sns topic request={}", request);
return Blocking.get(() -> sns().deleteTopic(request))
.transform(breaker);
}
示例8: addPermission
import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<AddPermissionResult> addPermission(
String topicArn,
String label,
List<String> aWSAccountIds,
List<String> actionNames
) {
return Blocking.get(() -> sns().addPermission(topicArn, label, actionNames, actionNames))
.transform(breaker);
}
示例9: checkIfPhoneNumberIsOptedOut
import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<CheckIfPhoneNumberIsOptedOutResult> checkIfPhoneNumberIsOptedOut(
CheckIfPhoneNumberIsOptedOutRequest request
) {
return Blocking.get(() -> sns().checkIfPhoneNumberIsOptedOut(request))
.transform(breaker);
}
示例10: confirmSubscription
import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<ConfirmSubscriptionResult> confirmSubscription(
String topicArn,
String token,
String authenticateOnUnsubscribe
) {
return Blocking.get(() -> sns().confirmSubscription(topicArn, token, authenticateOnUnsubscribe))
.transform(breaker);
}
示例11: createPlatformApplication
import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<CreatePlatformApplicationResult> createPlatformApplication(
CreatePlatformApplicationRequest request
) {
return Blocking.get(() -> sns().createPlatformApplication(request))
.transform(breaker);
}
示例12: deletePlatformApplication
import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<DeletePlatformApplicationResult> deletePlatformApplication(
DeletePlatformApplicationRequest request
) {
return Blocking.get(() -> sns().deletePlatformApplication(request))
.transform(breaker);
}
示例13: getPlatformApplicationAttributes
import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<GetPlatformApplicationAttributesResult> getPlatformApplicationAttributes(
GetPlatformApplicationAttributesRequest request
) {
return Blocking.get(() -> sns().getPlatformApplicationAttributes(request))
.transform(breaker);
}
示例14: getSubscriptionAttributes
import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<GetSubscriptionAttributesResult> getSubscriptionAttributes(
GetSubscriptionAttributesRequest request
) {
return Blocking.get(() -> sns().getSubscriptionAttributes(request))
.transform(breaker);
}
示例15: listEndpointsByPlatformApplication
import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<ListEndpointsByPlatformApplicationResult> listEndpointsByPlatformApplication(
ListEndpointsByPlatformApplicationRequest request
) {
return Blocking.get(() -> sns().listEndpointsByPlatformApplication(request))
.transform(breaker);
}