Asynchronous APIs¶
Get Entity Data¶
DataQuery query = new DataQuery().from(EventServiceMetadata.EntitySets.events);
eventService.getEventsAsync(query,
(events) -> {
for (Event e: events) {
logger.info("Event name: " + e.getName());
}
},
(error) -> {
logger.error("Request failed due to: " + error.getMessage());
}
);
val query = DataQuery().from(EventServiceMetadata.EntitySets.events)
eventService.getEventsAsync(query,
{ events ->
for (event in events) {
logger.info("Event name: " + e.name)
}
},
{ error ->
logger.error("Request failed due to: " + error.message)
}
)
Make Simultaneous Requests¶
DataQuery eventsquery = new DataQuery().from(EventServiceMetadata.EntitySets.events);
eventService.getEventsAsync(eventsquery,
(events) -> {
for (Event e : events) {
logger.info("Event name: " + e.getName());
}
},
(error) -> {
logger.error("Request failed due to: " + error.getMessage());
}
);
DataQuery exhibitorsquery = new DataQuery().from(EventServiceMetadata.EntitySets.exhibitors);
eventService.getExhibitorsAsync(exhibitorsquery,
(exhibitors) -> {
for (Exhibitor e : exhibitors) {
logger.info("Exhibitor name: " + e.getName());
}
},
(error) -> {
logger.error("Request failed due to: " + error.getMessage());
}
);
val eventsquery = DataQuery().from(EventServiceMetadata.EntitySets.events)
eventService.getEventsAsync(eventsquery,
{ events ->
for (event in events) {
logger.info("Event name: " + event.name)
}
},
{ error ->
logger.error("Request failed due to: " + error.message)
}
)
val exhibitorsquery = DataQuery().from(EventServiceMetadata.EntitySets.exhibitors)
eventService.getExhibitorsAsync(exhibitorsquery,
{ exhibitors ->
for (exhibitor in exhibitors) {
logger.info("Exhibitor name: " + exhibitor.name)
}
},
{ error ->
logger.error("Request failed due to: " + error.message)
}
)
Last update: April 14, 2021