Packages

case class Requests(credentials: HttpCredentials, ratelimitActor: ActorRef[Command], millisecondPrecision: Boolean = true, relativeTime: Boolean = false, parallelism: Int = 4, maxRetryCount: Int = 3, bufferSize: Int = 32, overflowStrategy: OverflowStrategy = OverflowStrategy.backpressure, maxAllowedWait: FiniteDuration = 2.minutes, alsoProcessRequests: Sink[(Request[Data], RequestAnswer[Data]) forSome {type Data}, NotUsed] = Sink.ignore.mapMaterializedValue(_ => NotUsed))(implicit system: ActorSystem[Nothing]) 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
Requests.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Requests
  2. Serializable
  3. Product
  4. Equals
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Requests(credentials: HttpCredentials, ratelimitActor: ActorRef[Command], millisecondPrecision: Boolean = true, relativeTime: Boolean = false, parallelism: Int = 4, maxRetryCount: Int = 3, bufferSize: Int = 32, overflowStrategy: OverflowStrategy = OverflowStrategy.backpressure, maxAllowedWait: FiniteDuration = 2.minutes, alsoProcessRequests: Sink[(Request[Data], RequestAnswer[Data]) forSome {type Data}, NotUsed] = Sink.ignore.mapMaterializedValue(_ => NotUsed))(implicit system: ActorSystem[Nothing])

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. val alsoProcessRequests: Sink[(Request[Data], RequestAnswer[Data]) forSome {type Data}, NotUsed]
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. val bufferSize: Int
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  8. val credentials: HttpCredentials
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  11. def flow[Data, Ctx](implicit properties: RequestProperties = RequestProperties.default): FlowWithContext[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.

  12. def flowSuccess[Data, Ctx](ignoreFailures: Boolean = true)(implicit properties: RequestProperties = RequestProperties.default): FlowWithContext[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.

    ignoreFailures

    If true, failures will be logged and then ignored. If false, throws the failures

  13. def flowWithoutRateLimits[Data, Ctx]: FlowWithContext[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.

  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. def many[Data](requests: Seq[Request[Data]])(implicit properties: RequestProperties = RequestProperties.default): Source[RequestAnswer[Data], NotUsed]

    Sends many requests

    Sends many requests

    requests

    The requests to send.

    returns

    A source of the request answers.

  17. def manyFuture[Data](requests: Seq[Request[Data]])(implicit properties: RequestProperties = RequestProperties.default): Future[Seq[RequestAnswer[Data]]]

    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.

  18. def manyFutureSuccess[Data](requests: Seq[Request[Data]])(implicit properties: RequestProperties = RequestProperties.default): Future[Seq[Data]]

    Sends many requests and gets the success response as a future if it's available.

    Sends many requests and gets the success response as a future if it's available. All the requests must succeed for this function to return a a value.

    requests

    The requests to send.

  19. def manyIgnore[Data](requests: Seq[Request[Data]])(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.

  20. def manySuccess[Data](requests: Seq[Request[Data]], ignoreFailures: Boolean = true)(implicit properties: RequestProperties = RequestProperties.default): Source[Data, NotUsed]

    Sends many requests, and grabs the data if it's available.

    Sends many requests, and grabs the data if it's available.

    requests

    The requests to send.

    ignoreFailures

    If true, failures will be logged and then ignored. If false, throws the failures

    returns

    A source of the successful request answers.

  21. val maxAllowedWait: FiniteDuration
  22. val maxRetryCount: Int
  23. val millisecondPrecision: Boolean
  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. def productElementNames: Iterator[String]
    Definition Classes
    Product
  30. val ratelimitActor: ActorRef[Command]
  31. val relativeTime: Boolean
  32. def single[Data](request: Request[Data])(implicit properties: RequestProperties = RequestProperties.default): Source[RequestAnswer[Data], 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](request: Request[Data])(implicit properties: RequestProperties = RequestProperties.default): Future[RequestAnswer[Data]]

    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 singleFutureSuccess[Data](request: Request[Data])(implicit properties: RequestProperties = RequestProperties.default): Future[Data]

    Sends a single request and gets the success response as a future if it's available.

    Sends a single request and gets the success response as a future if it's available. If the request fails, the future fails.

    request

    The request to send.

  35. def singleIgnore[Data](request: Request[Data])(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.

  36. def singleSuccess[Data](request: Request[Data])(implicit properties: RequestProperties = RequestProperties.default): Source[Data, NotUsed]

    Sends a single request, and grabs the data if it's available.

    Sends a single request, and grabs the data if it's available.

    request

    The request to send.

    returns

    A source of the successful request answer.

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

  38. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  39. implicit val system: ActorSystem[Nothing]
  40. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  41. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  42. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped