8000 Some pretty name have been introduced · LarsG/postgres-async-driver@fac449a · GitHub
[go: up one dir, main page]

Skip to content

Commit fac449a

Browse files
Some pretty name have been introduced
1 parent dcc1931 commit fac449a

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/main/java/com/github/pgasync/PgProtocolStream.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public Runnable subscribe(String channel, Consumer<String> onNotification) {
145145
});
146146
}
147147

148-
protected void respondWithException(Throwable th) {
148+
protected void gotException(Throwable th) {
149149
onColumns = null;
150150
onRow = null;
151151
onAffected = null;
@@ -157,7 +157,7 @@ protected void respondWithException(Throwable th) {
157157
}
158158
}
159159

160-
protected void respondWithMessage(Message message) {
160+
protected void gotMessage(Message message) {
161161
if (message instanceof NotificationResponse) {
162162
publish((NotificationResponse) message);
163163
} else if (message == BIndicators.BIND_COMPLETE) {
@@ -174,7 +174,7 @@ protected void respondWithMessage(Message message) {
174174
if (seenReadyForQuery) {
175175
readyForQueryPendingMessage = message;
176176
} else {
177-
respondWithException(toSqlException((ErrorResponse) message));
177+
gotException(toSqlException((ErrorResponse) message));
178178
}
179179
} else if (message instanceof CommandComplete) {
180180
if (isSimpleQueryInProgress()) {
@@ -195,7 +195,7 @@ protected void respondWithMessage(Message message) {
195195
} else if (message == ReadyForQuery.INSTANCE) {
196196
seenReadyForQuery = true;
197197
if (readyForQueryPendingMessage instanceof ErrorResponse) {
198-
respondWithException(toSqlException((ErrorResponse) readyForQueryPendingMessage));
198+
gotException(toSqlException((ErrorResponse) readyForQueryPendingMessage));
199199
} else {
200200
onColumns = null;
201201
onRow = null;
@@ -229,7 +229,7 @@ protected CompletableFuture<Message> offerRoundTrip(Runnable requestAction, bool
229229
try {
230230
requestAction.run();
231231
} catch (Throwable th) {
232-
respondWithException(th);
232+
gotException(th);
233233
}
234234
} else {
235235
futuresExecutor.execute(() -> uponResponse.completeExceptionally(new IllegalStateException("Postgres messages stream simultaneous use detected")));

src/test/java/com/github/pgasync/netty/NettyPgProtocolStream.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public class NettyPgProtocolStream extends PgProtocolStream {
5555

5656
private final GenericFutureListener<Future<? super Object>> outboundErrorListener = written -> {
5757
if (!written.isSuccess()) {
58-
respondWithException(written.cause());
58+
gotException(written.cause());
5959
}
6060
};
6161

@@ -162,23 +162,23 @@ private ChannelHandler newProtocolHandler() {
162162
public void channelActive(ChannelHandlerContext context) {
163163
NettyPgProtocolStream.this.ctx = context;
164164
if (useSsl) {
165-
respondWithMessage(SSLRequest.INSTANCE);
165+
gotMessage(SSLRequest.INSTANCE);
166166
} else {
167-
respondWithMessage(startupWith);
167+
gotMessage(startupWith);
168168
}
169169
}
170170

171171
@Override
172172
public void userEventTriggered(ChannelHandlerContext context, Object evt) {
173173
if (evt instanceof SslHandshakeCompletionEvent && ((SslHandshakeCompletionEvent) evt).isSuccess()) {
174-
respondWithMessage(SSLHandshake.INSTANCE);
174+
gotMessage(SSLHandshake.INSTANCE);
175175
}
176176
}
177177

178178
@Override
179179
public void channelRead(ChannelHandlerContext context, Object message) {
180180
if (message instanceof Message) {
181-
respondWithMessage((Message) message);
181+
gotMessage((Message) message);
182182
}
183183
}
184184

@@ -189,7 +189,7 @@ public void channelInactive(ChannelHandlerContext context) {
189189

190190
@Override
191191
public void exceptionCaught(ChannelHandlerContext context, Throwable cause) {
192-
respondWithException(cause);
192+
gotException(cause);
193193
}
194194
};
195195
}

0 commit comments

Comments
 (0)
0