Package discord4j.voice
Class DefaultVoiceConnectionFactory
- java.lang.Object
-
- discord4j.voice.DefaultVoiceConnectionFactory
-
- All Implemented Interfaces:
VoiceConnectionFactory
public class DefaultVoiceConnectionFactory extends Object implements VoiceConnectionFactory
Default implementation for aVoiceConnectionFactory
. It uses aDefaultVoiceGatewayClient
to createVoiceConnection
instances. Protects against concurrentcreate(VoiceGatewayOptions)
calls by sharing theMono
subscription that actually establishes a voice connection.
-
-
Constructor Summary
Constructors Constructor Description DefaultVoiceConnectionFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Mono<VoiceConnection>
create(VoiceGatewayOptions options)
Return aMono
that, upon subscription, is able to obtain aVoiceConnection
from the givenVoiceGatewayOptions
.
-
-
-
Method Detail
-
create
public Mono<VoiceConnection> create(VoiceGatewayOptions options)
Description copied from interface:VoiceConnectionFactory
Return aMono
that, upon subscription, is able to obtain aVoiceConnection
from the givenVoiceGatewayOptions
. The resulting connection can be an existing one if it's still active for a guild.- Specified by:
create
in interfaceVoiceConnectionFactory
- Parameters:
options
- the set of options to configure voice connections- Returns:
- a
Mono
that, upon subscription, can return aVoiceConnection
. In case an error occurs, it is emitted through theMono
.
-
-