use of org.ballerinalang.nativeimpl.io.events.records.CloseDelimitedRecordEvent in project ballerina by ballerina-lang.
the class IOUtils method close.
/**
* Closes the delimited record channel asynchronously.
*
* @param charChannel channel which should be closed.
* @param eventContext context of the event.
* @param function callback function which will be triggered.
*/
public static void close(DelimitedRecordChannel charChannel, EventContext eventContext, Function<EventResult, EventResult> function) {
CloseDelimitedRecordEvent closeEvent = new CloseDelimitedRecordEvent(charChannel, eventContext);
CompletableFuture<EventResult> future = EventManager.getInstance().publish(closeEvent);
future.thenApply(function);
}
Aggregations