wink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francesco Chicchiriccò <ilgro...@apache.org>
Subject InputStream & async examples
Date Tue, 04 Jun 2013 08:36:06 GMT
Hi all,
I am currently evaluating Wink for a new project.

I have been playing around with some samples and it seems linear to me.
I am not completely convinced, however, of async usage; this is how I 
have managed to get it working:

         AsyncHttpClient asyncHttpClient = new AsyncHttpClient();
         RestClient client = new RestClient(new 
AsyncHttpClientConfiguration(asyncHttpClient));

         Resource resource =
client.resource("http://services.odata.org/v3/(S(sn4zeecdefwvblk2xxlk425x))/OData/OData.svc/Products");
         AtomFeed feed = 
resource.contentType("application/atom+xml").accept("application/atom+xml").get(AtomFeed.class);
         asyncHttpClient.close();

         for (AtomEntry entry : feed.getEntries()) {
             System.out.println(entry.getTitle().getValue());
         }

Is this the correct usage? Isn't there any way to get something like 
Future<AtomFeed> instead?

Moreover, I was also looking for a way to get an InputStream out of a 
response, to delay processing: is this possible?

Thanks for your support.
Regards.

-- 
Francesco Chicchiriccò

ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
http://people.apache.org/~ilgrosso/


Mime
View raw message