本文整理汇总了Java中cloud.orbit.concurrent.Task.join方法的典型用法代码示例。如果您正苦于以下问题:Java Task.join方法的具体用法?Java Task.join怎么用?Java Task.join使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cloud.orbit.concurrent.Task
的用法示例。
在下文中一共展示了Task.join方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testTaskVoidReturnWithException
import cloud.orbit.concurrent.Task; //导入方法依赖的package包/类
@Test
public void testTaskVoidReturnWithException()
{
WebTarget webTarget = getWebTarget();
final Hello hello = new RestClient(webTarget).get(Hello.class);
try
{
Task<Void> voidTask = hello.taskVoidReturnWithException("blah");
voidTask.join();
}
catch (Exception e)
{
return;
}
fail();
}
示例2: testParams
import cloud.orbit.concurrent.Task; //导入方法依赖的package包/类
@Test
public void testParams()
{
WebTarget webTarget = getWebTarget();
final Hello hello = new RestClient(webTarget).get(Hello.class);
final MessageDto message = new MessageDto();
message.data = "data0";
message.x = 10;
message.list = Arrays.asList("a", "b", "c");
final Task<SomeResponseDto> resp = hello.getParams("pp", "xx", "qq", null, message);
final SomeResponseDto r0 = resp.join();
assertEquals("pp:xx:qq:oo:data0", r0.resp);
assertEquals("data0", r0.original.data);
assertEquals("b", r0.original.list.get(1));
assertEquals(10, r0.original.x);
}
示例3: main
import cloud.orbit.concurrent.Task; //导入方法依赖的package包/类
public static void main(String args[])
{
WebTarget webTarget = getWebTarget("http://example.com");
Hello hello = new RestClient(webTarget).get(Hello.class);
Task<String> response = hello.getHome();
response.thenAccept(x -> System.out.println(x));
response.join();
}
示例4: testGenericReturn
import cloud.orbit.concurrent.Task; //导入方法依赖的package包/类
@Test
public void testGenericReturn()
{
WebTarget webTarget = getWebTarget();
final Hello hello = new RestClient(webTarget).get(Hello.class);
final Task<Map<String, SomeResponseDto>> resp = hello.getGenericReturn("xx");
final Map<String, SomeResponseDto> map = resp.join();
assertEquals("::xx", map.get("xx").resp);
}