publish method
Implementation
Completer<void> publish(final PublishEvent event) {
Completer<void> publishFuture = Completer<void>();
var content = serializer_?.serialize(event);
httpClient_.put(url_, null, headers_, content).then((response) {
final int code = response.getStatusCode() ?? 0;
if ((code / 100) == 2) {
publishFuture.complete();
} else {
publishFuture
.completeError(Exception(response.getStatusMessage() ?? ""));
}
}).catchError((exception) {
publishFuture.completeError(exception);
});
return publishFuture;
}