Skip to content

Asynchronous APIs

Get Entity Data

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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());
    }
);
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
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());
    }
);
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
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)
    }
)