Packages

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
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](implicit properties: RequestProperties = RequestProperties.default): 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.

    Some info on ordered requests. Once a response for one request has been received, the next one is sent. The next one is sent regardless of if the previous request failed. Ordered requests still have a few kinks that need to be removed before they always work.

  11. def flowSuccess[Data, Ctx](implicit properties: RequestProperties = RequestProperties.default): 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]])(implicit properties: RequestProperties = RequestProperties.default): 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]])(implicit properties: RequestProperties = RequestProperties.default): 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]])(implicit properties: RequestProperties = RequestProperties.default): Unit

    Sends many requests and ignores the result.

    Sends many requests and ignores the result.

    requests

    The requests to send.

  18. implicit val mat: Materializer
  19. val maxAllowedWait: FiniteDuration
  20. val maxRetryCount: Int
  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. val overflowStrategy: OverflowStrategy
  25. val parallelism: Int
  26. val ratelimitActor: ActorRef
  27. def single[Data, Ctx](request: Request[Data, Ctx])(implicit properties: RequestProperties = RequestProperties.default): 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.

  28. def singleFuture[Data, Ctx](request: Request[Data, Ctx])(implicit properties: RequestProperties = RequestProperties.default): 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.

  29. def singleIgnore[Data, Ctx](request: Request[Data, Ctx])(implicit properties: RequestProperties = RequestProperties.default): Unit

    Sends a single request and ignores the result.

    Sends a single request and ignores the result.

    request

    The request to send.

  30. def sinkIgnore[Data, Ctx](implicit properties: RequestProperties = RequestProperties.default): 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.

  31. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  32. implicit val system: ActorSystem
  33. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped