Package io.sentry.transport
Class AsyncHttpTransport
java.lang.Object
io.sentry.transport.AsyncHttpTransport
- All Implemented Interfaces:
ITransport,Closeable,AutoCloseable
ITransport implementation that executes request asynchronously in a blocking manner using
HttpURLConnection.-
Constructor Summary
ConstructorsConstructorDescriptionAsyncHttpTransport(@NotNull SentryOptions options, @NotNull RateLimiter rateLimiter, @NotNull ITransportGate transportGate, @NotNull RequestDetails requestDetails) AsyncHttpTransport(@NotNull io.sentry.transport.QueuedThreadPoolExecutor executor, @NotNull SentryOptions options, @NotNull RateLimiter rateLimiter, @NotNull ITransportGate transportGate, @NotNull io.sentry.transport.HttpConnection httpConnection) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidclose(boolean isRestarting) Closes the transport.voidflush(long timeoutMillis) Flushes events queued up, but keeps the client enabled.@NotNull RateLimiterbooleanvoidsend(@NotNull SentryEnvelope envelope, @NotNull Hint hint) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.sentry.transport.ITransport
send
-
Constructor Details
-
AsyncHttpTransport
public AsyncHttpTransport(@NotNull @NotNull SentryOptions options, @NotNull @NotNull RateLimiter rateLimiter, @NotNull @NotNull ITransportGate transportGate, @NotNull @NotNull RequestDetails requestDetails) -
AsyncHttpTransport
public AsyncHttpTransport(@NotNull @NotNull io.sentry.transport.QueuedThreadPoolExecutor executor, @NotNull @NotNull SentryOptions options, @NotNull @NotNull RateLimiter rateLimiter, @NotNull @NotNull ITransportGate transportGate, @NotNull @NotNull io.sentry.transport.HttpConnection httpConnection)
-
-
Method Details
-
send
public void send(@NotNull @NotNull SentryEnvelope envelope, @NotNull @NotNull Hint hint) throws IOException - Specified by:
sendin interfaceITransport- Throws:
IOException
-
flush
public void flush(long timeoutMillis) Description copied from interface:ITransportFlushes events queued up, but keeps the client enabled.- Specified by:
flushin interfaceITransport- Parameters:
timeoutMillis- time in milliseconds
-
getRateLimiter
- Specified by:
getRateLimiterin interfaceITransport
-
isHealthy
public boolean isHealthy()- Specified by:
isHealthyin interfaceITransport
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
close
Description copied from interface:ITransportCloses the transport.- Specified by:
closein interfaceITransport- Parameters:
isRestarting- if true, avoids locking the main thread by dropping the current connection.- Throws:
IOException
-