case class RequestHelper(credentials: HttpCredentials, ratelimitActor: ActorRef, parallelism: Int = 4, maxRetryCount: Int = 3, bufferSize: Int = 32, overflowStrategy: OverflowStrategy = OverflowStrategy.backpressure, maxAllowedWait: FiniteDuration = 2.minutes)(implicit system: ActorSystem, mat: Materializer) extends Product with Serializable

A class holding all the relevant information to create a request stream. Also contains some convenience methods for common operations with requests.

This should be instantiated once per bot, and shared between shards.

Source
RequestHelper.scala
Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RequestHelper
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RequestHelper(credentials: HttpCredentials, ratelimitActor: ActorRef, parallelism: Int = 4, maxRetryCount: Int = 3, bufferSize: Int = 32, overflowStrategy: OverflowStrategy = OverflowStrategy.backpressure, maxAllowedWait: FiniteDuration = 2.minutes)(implicit system: ActorSystem, mat: Materializer)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. val bufferSize: Int
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  7. val credentials: HttpCredentials
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. def flow[Data, Ctx]: Flow[Request[Data, Ctx], RequestAnswer[Data, Ctx], NotUsed]

    A generic flow for making requests.

    A generic flow for making requests. You should use this one most of the time. Backpressures before it hits a ratelimit.

  11. def flowSuccess[Data, Ctx]: Flow[Request[Data, Ctx], (Data, Ctx), NotUsed]

    A generic flow for making requests.

    A generic flow for making requests. Only returns successful requests. Backpressures before it hits a ratelimit.

  12. def flowWithoutRateLimits[Data, Ctx]: Flow[Request[Data, Ctx], RequestAnswer[Data, Ctx], NotUsed]

    A basic request flow which will send requests to Discord, and receive responses.

    A basic request flow which will send requests to Discord, and receive responses. Don't use this if you don't know what you're doing.

  13. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. def many[Data, Ctx](requests: Seq[Request[Data, Ctx]]): Source[RequestAnswer[Data, Ctx], NotUsed]

    Sends many requests

    Sends many requests

    requests

    The requests to send.

    returns

    A source of the request answers.

  16. def manyFuture[Data, Ctx](requests: Seq[Request[Data, Ctx]]): Future[Seq[RequestAnswer[Data, Ctx]]]

    Sends many requests and gets the responses as a future.

    Sends many requests and gets the responses as a future.

    requests

    The requests to send.

  17. def manyIgnore[Data, Ctx](requests: Seq[Request[Data, Ctx]]): Unit

    Sends many requests and ignores the result.

    Sends many requests and ignores the result.

    requests

    The requests to send.

  18. def manyRetry[Data, Ctx](requests: Seq[Request[Data, Ctx]]): Source[RequestResponse[Data, Ctx], NotUsed]

    Sends many which will retry if they fail.

    Sends many which will retry if they fail.

    requests

    The requests to send.

    returns

    A source of the retried requests.

  19. def manyRetryFuture[Data, Ctx](requests: Seq[Request[Data, Ctx]]): Future[Seq[RequestResponse[Data, Ctx]]]

    Sends many requests with retries if they fail, and gets the response as a future.

    Sends many requests with retries if they fail, and gets the response as a future.

    requests

    The requests to send.

  20. def manyRetryIgnore[Data, Ctx](requests: Seq[Request[Data, Ctx]]): Unit

    Sends many requests with retries if they fail, and ignores the result.

    Sends many requests with retries if they fail, and ignores the result.

    requests

    The requests to send.

  21. implicit val mat: Materializer
  22. val maxAllowedWait: FiniteDuration
  23. val maxRetryCount: Int
  24. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  25. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  27. val overflowStrategy: OverflowStrategy
  28. val parallelism: Int
  29. val ratelimitActor: ActorRef
  30. def retryFlow[Data, Ctx]: Flow[Request[Data, Ctx], RequestResponse[Data, Ctx], NotUsed]

    A request flow that will retry failed requests.

  31. def retrySinkIgnore[Data, Ctx]: Sink[Request[Data, Ctx], Future[Done]]

    A sink for making requests and ignoring the results that will retry on error.

    A sink for making requests and ignoring the results that will retry on error. Backpressures before it hits a ratelimit.

  32. def single[Data, Ctx](request: Request[Data, Ctx]): Source[RequestAnswer[Data, Ctx], NotUsed]

    Sends a single request.

    Sends a single request.

    request

    The request to send.

    returns

    A source of the single request answer.

  33. def singleFuture[Data, Ctx](request: Request[Data, Ctx]): Future[RequestAnswer[Data, Ctx]]

    Sends a single request and gets the response as a future.

    Sends a single request and gets the response as a future.

    request

    The request to send.

  34. def singleIgnore[Data, Ctx](request: Request[Data, Ctx]): Unit

    Sends a single request and ignores the result.

    Sends a single request and ignores the result.

    request

    The request to send.

  35. def singleRetry[Data, Ctx](request: Request[Data, Ctx]): Source[RequestResponse[Data, Ctx], NotUsed]

    Sends a single request which will retry if it fails.

    Sends a single request which will retry if it fails.

    NOTE: This Source sometimes stops working.

    request

    The request to send.

    returns

    A source of the retried request.

  36. def singleRetryFuture[Data, Ctx](request: Request[Data, Ctx]): Future[RequestResponse[Data, Ctx]]

    Sends a single request with retries if it fails, and gets the response as a future.

    Sends a single request with retries if it fails, and gets the response as a future.

    request

    The request to send.

  37. def singleRetryIgnore[Data, Ctx](request: Request[Data, Ctx]): Unit

    Sends a single request with retries if it fails, and ignores the result.

    Sends a single request with retries if it fails, and ignores the result.

    request

    The request to send.

  38. def sinkIgnore[Data, Ctx]: Sink[Request[Data, Ctx], Future[Done]]

    A generic sink for making requests and ignoring the results.

    A generic sink for making requests and ignoring the results. Backpressures before it hits a ratelimit.

  39. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  40. implicit val system: ActorSystem
  41. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Deprecated Value Members

  1. def retry[Data, Ctx](request: Request[Data, Ctx]): Source[RequestResponse[Data, Ctx], NotUsed]
    Annotations
    @deprecated
    Deprecated

    (Since version 0.11.0) Prefer singleRetry instead

  2. def retryFuture[Data, Ctx](request: Request[Data, Ctx]): Future[RequestResponse[Data, Ctx]]
    Annotations
    @deprecated
    Deprecated

    (Since version 0.11.0) Prefer singleRetryFuture instead

  3. def retryIgnore[Data, Ctx](request: Request[Data, Ctx]): Unit
    Annotations
    @deprecated
    Deprecated

    (Since version 0.11.0) Prefer singleRetryIgnore instead

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped