Class VoiceReactorResources

java.lang.Object
discord4j.common.ReactorResources
discord4j.voice.VoiceReactorResources

public class VoiceReactorResources extends ReactorResources
Provides an extra level of configuration for ReactorResources, tailored for the Voice Gateway operations.

Allows customizing the Scheduler used to send and receive voice packets and also the UdpClient template for establishing UDP connections.

  • Constructor Details

    • VoiceReactorResources

      public VoiceReactorResources(ReactorResources parent)
      Create Voice Gateway resources based off ReactorResources properties, and providing defaults for the remaining properties.
      Parameters:
      parent - the resources instance to get properties from
    • VoiceReactorResources

      public VoiceReactorResources(ReactorResources parent, UdpClient udpClient, Scheduler sendTaskScheduler, Scheduler receiveTaskScheduler)
      Create Voice Gateway resources based off ReactorResources properties, and allowing customization of the remaining properties.
      Parameters:
      parent - the resources instance to get properties from
      udpClient - the UDP client used to create voice protocol connections
      sendTaskScheduler - the scheduler used to run the voice send loop
      receiveTaskScheduler - the scheduler used to run the voice receive loop
    • VoiceReactorResources

      public VoiceReactorResources(HttpClient httpClient, Scheduler timerTaskScheduler, Scheduler blockingTaskScheduler, UdpClient udpClient, Scheduler sendTaskScheduler, Scheduler receiveTaskScheduler)
      Create Voice Gateway resources allowing full customization of its properties.
      Parameters:
      httpClient - the HTTP client to use for initiating Gateway websocket connections. A default is provided in ReactorResources.DEFAULT_HTTP_CLIENT
      timerTaskScheduler - the scheduler for timed tasks. A default can be created from ReactorResources.DEFAULT_TIMER_TASK_SCHEDULER
      blockingTaskScheduler - the scheduler for blocking tasks. A default can be created from ReactorResources.DEFAULT_BLOCKING_TASK_SCHEDULER
      udpClient - the UDP client used to create voice protocol connections
      sendTaskScheduler - the scheduler used to run the voice send loop
      receiveTaskScheduler - the scheduler used to run the voice receive loop
    • VoiceReactorResources

      protected VoiceReactorResources(VoiceReactorResources.Builder builder)
  • Method Details