case class Requests(settings: RequestSettings, 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
- Alphabetic
- By Inheritance
- Requests
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Requests(settings: RequestSettings, alsoProcessRequests: Sink[(Request[Data], RequestAnswer[Data]) forSome {type Data}, NotUsed] = Sink.ignore.mapMaterializedValue(_ => NotUsed))(implicit system: ActorSystem[Nothing])
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val alsoProcessRequests: Sink[(Request[Data], RequestAnswer[Data]) forSome {type Data}, NotUsed]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- 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.
- 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
- 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.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- 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.
- 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.
- 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.
- 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.
- 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.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- val settings: RequestSettings
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- implicit val system: ActorSystem[Nothing]
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])