Class MailClient
- All Implemented Interfaces:
MutinyDelegate
A simple asynchronous API for sending mails from Vert.x applications
NOTE: This class has been automatically generated from theoriginal
non Mutiny-ified interface using Vert.x codegen.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TypeArg<MailClient>
static final String
The name of the default pool -
Constructor Summary
ConstructorsConstructorDescriptionMailClient
(io.vertx.ext.mail.MailClient delegate) MailClient
(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionio.smallrye.mutiny.Uni<Void>
close()
Close the MailClientBlocking variant ofclose()
.void
Variant ofclose()
that ignores the result of the operation.static MailClient
static MailClient
createShared
(Vertx vertx, io.vertx.ext.mail.MailConfig config) static MailClient
createShared
(Vertx vertx, io.vertx.ext.mail.MailConfig config, String poolName) boolean
io.vertx.ext.mail.MailClient
int
hashCode()
static MailClient
newInstance
(io.vertx.ext.mail.MailClient arg) io.smallrye.mutiny.Uni<io.vertx.ext.mail.MailResult>
sendMail
(io.vertx.ext.mail.MailMessage email) send a single mail via MailClientio.vertx.ext.mail.MailResult
sendMailAndAwait
(io.vertx.ext.mail.MailMessage email) Blocking variant ofsendMail(MailMessage)
.sendMailAndForget
(io.vertx.ext.mail.MailMessage email) Variant ofsendMail(MailMessage)
that ignores the result of the operation.toString()
-
Field Details
-
__TYPE_ARG
-
DEFAULT_POOL_NAME
The name of the default pool- See Also:
-
-
Constructor Details
-
MailClient
public MailClient(io.vertx.ext.mail.MailClient delegate) -
MailClient
-
-
Method Details
-
getDelegate
public io.vertx.ext.mail.MailClient getDelegate()- Specified by:
getDelegate
in interfaceMutinyDelegate
- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
create
- Parameters:
vertx
- the Vertx instance the operation will be run inconfig
- MailConfig configuration to be used for sending mails- Returns:
- MailClient instance that can then be used to send multiple mails
-
sendMail
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.ext.mail.MailResult> sendMail(io.vertx.ext.mail.MailMessage email) send a single mail via MailClientUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
email
- MailMessage object containing the mail text, from/to, attachments etc- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
sendMailAndAwait
public io.vertx.ext.mail.MailResult sendMailAndAwait(io.vertx.ext.mail.MailMessage email) Blocking variant ofsendMail(MailMessage)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
email
- MailMessage object containing the mail text, from/to, attachments etc- Returns:
- the MailResult instance produced by the operation.
-
sendMailAndForget
Variant ofsendMail(MailMessage)
that ignores the result of the operation.This method subscribes on the result of
sendMail(MailMessage)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromsendMail(MailMessage)
but you don't need to compose it with other operations.- Parameters:
email
- MailMessage object containing the mail text, from/to, attachments etc- Returns:
- the instance of MailClient to chain method calls.
-
close
Close the MailClientUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
closeAndAwait
Blocking variant ofclose()
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
closeAndForget
public void closeAndForget() -
newInstance
-