vert-x3/vertx-mail-client

SMTPConnection clean up

gaol opened this issue · 0 comments

gaol commented

Code clean up

  • The following handlers are used in SMTPConnection to handle success response and error, they should be changed to Handler<AsyncResult<String>> handler instead. The implementation in vertx-mqtt-client can be referenced.
  private Handler<String> commandReplyHandler;
  private Handler<Throwable> errorHandler;
  • The Handler<String> initialReplyHandler should be updated to Handler<AsyncResult<String>> initialReplyHandler
void init(Handler<String> initialReplyHandler)
  • The private Handler<Throwable> errorHandler should be removed
  • The void write(String str, Handler<String> commandResultHandler) should be changed to void write(String str, Handler<AsyncResult<String>> commandResultHandler)

Overall any operation that has an Handler<T> should be Handler<AsyncResult<T>>