<divclass="inheritance"title="Inheritance Tree"><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html"title="class or interface in java.lang"class="external-link">java.lang.Object</a>
<spanclass="extends-implements">extends <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html"title="class or interface in java.lang"class="external-link">Object</a>
implements <ahref="../api/Identifier.html"title="interface in io.github.simplexdevelopment.api">Identifier</a></span></div>
<divclass="block">A service pool is a collection of services which are managed by a single scheduler.
The scheduler can either be an instance of <code>Scheduler</code> or <ahref="ReactorBukkitScheduler.html"title="class in io.github.simplexdevelopment.scheduler"><code>ReactorBukkitScheduler</code></a>.
Using <code>Scheduler</code> allows for more flexibility, but doesn't communicate with the Main thread.
Using <ahref="ReactorBukkitScheduler.html"title="class in io.github.simplexdevelopment.scheduler"><code>ReactorBukkitScheduler</code></a> allows for communication with the Main thread, but is less flexible.</div>
<dlclass="notes">
<dt>See Also:</dt>
<dd>
<ulclass="see-list">
<li><ahref="ReactorBukkitScheduler.html"title="class in io.github.simplexdevelopment.scheduler"><code>ReactorBukkitScheduler</code></a></li>
<divclass="col-constructor-name even-row-color"><code><ahref="#%3Cinit%3E(java.lang.String,boolean)"class="member-name-link">ServicePool</a><wbr>(<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html"title="class or interface in java.lang"class="external-link">String</a> name,
boolean multithreaded)</code></div>
<divclass="col-last even-row-color">
<divclass="block">This will create a new instance of a Service Pool with a <code>Scheduler</code> as its main scheduler.</div>
</div>
<divclass="col-constructor-name odd-row-color"><code><ahref="#%3Cinit%3E(java.lang.String,org.bukkit.plugin.java.JavaPlugin)"class="member-name-link">ServicePool</a><wbr>(<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html"title="class or interface in java.lang"class="external-link">String</a> name,
<divclass="block">This will create a new instance of a Service Pool with the <ahref="ReactorBukkitScheduler.html"title="class in io.github.simplexdevelopment.scheduler"><code>ReactorBukkitScheduler</code></a> as its main scheduler.</div>
<divclass="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>@NotNull <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Set.html"title="class or interface in java.util"class="external-link">Set</a><<ahref="../api/IService.html"title="interface in io.github.simplexdevelopment.api">IService</a>></code></div>
<divclass="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html"title="class or interface in java.lang"class="external-link">String</a></code></div>
<divclass="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>@NotNull reactor.core.publisher.Mono<<ahref="../api/IService.html"title="interface in io.github.simplexdevelopment.api">IService</a>></code></div>
<divclass="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><ahref="#getService(java.lang.String)"class="member-name-link">getService</a><wbr>(<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html"title="class or interface in java.lang"class="external-link">String</a> service_name)</code></div>
<divclass="block">Gets a service based on the name of the service defined by <ahref="../api/Identifier.html#getName()"><code>Identifier.getName()</code></a>.</div>
<divclass="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>@NotNull reactor.core.publisher.Mono<<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Void.html"title="class or interface in java.lang"class="external-link">Void</a>></code></div>
<divclass="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><ahref="#stopService(java.lang.String,reactor.core.publisher.Mono)"class="member-name-link">stopService</a><wbr>(@NotNull <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html"title="class or interface in java.lang"class="external-link">String</a> service_name,
<divclass="block">This is the method used to stop a service.</div>
</div>
<divclass="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>@NotNull reactor.core.publisher.Mono<<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Void.html"title="class or interface in java.lang"class="external-link">Void</a>></code></div>
<h3id="methods-inherited-from-class-java.lang.Object">Methods inherited from class java.lang.<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html"title="class or interface in java.lang"class="external-link">Object</a></h3>
<code><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#clone()"title="class or interface in java.lang"class="external-link">clone</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)"title="class or interface in java.lang"class="external-link">equals</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#finalize()"title="class or interface in java.lang"class="external-link">finalize</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#getClass()"title="class or interface in java.lang"class="external-link">getClass</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#hashCode()"title="class or interface in java.lang"class="external-link">hashCode</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notify()"title="class or interface in java.lang"class="external-link">notify</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notifyAll()"title="class or interface in java.lang"class="external-link">notifyAll</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#toString()"title="class or interface in java.lang"class="external-link">toString</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait()"title="class or interface in java.lang"class="external-link">wait</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long)"title="class or interface in java.lang"class="external-link">wait</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long,int)"title="class or interface in java.lang"class="external-link">wait</a></code></div>
<h3id="methods-inherited-from-class-io.github.simplexdevelopment.api.Identifier">Methods inherited from interface io.github.simplexdevelopment.api.<ahref="../api/Identifier.html"title="interface in io.github.simplexdevelopment.api">Identifier</a></h3>
<divclass="member-signature"><spanclass="modifiers">public</span> <spanclass="element-name">ServicePool</span><wbr><spanclass="parameters">(<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html"title="class or interface in java.lang"class="external-link">String</a> name,
boolean multithreaded)</span></div>
<divclass="block">This will create a new instance of a Service Pool with a <code>Scheduler</code> as its main scheduler.
This should be used if you'd like to execute tasks without communicating on the main server thread.</div>
<dlclass="notes">
<dt>Parameters:</dt>
<dd><code>name</code> - The name of this service pool.</dd>
<dd><code>multithreaded</code> - Whether this service pool should be multithreaded, or operate upon a single thread.</dd>
<divclass="member-signature"><spanclass="modifiers">public</span> <spanclass="element-name">ServicePool</span><wbr><spanclass="parameters">(<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html"title="class or interface in java.lang"class="external-link">String</a> name,
<divclass="block">This will create a new instance of a Service Pool with the <ahref="ReactorBukkitScheduler.html"title="class in io.github.simplexdevelopment.scheduler"><code>ReactorBukkitScheduler</code></a> as its main scheduler.
This should be used if you'd like to execute tasks while communicating on the main server thread.</div>
<dlclass="notes">
<dt>Parameters:</dt>
<dd><code>name</code> - The name of this service pool.</dd>
</span><spanclass="modifiers">public</span> <spanclass="return-type">@NotNull <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Set.html"title="class or interface in java.util"class="external-link">Set</a><<ahref="../api/IService.html"title="interface in io.github.simplexdevelopment.api">IService</a>></span> <spanclass="element-name">getAssociatedServices</span>()</div>
<dlclass="notes">
<dt>Returns:</dt>
<dd>A <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Set.html"title="class or interface in java.util"class="external-link"><code>Set</code></a> of <ahref="../api/IService.html"title="interface in io.github.simplexdevelopment.api"><code>IService</code></a> objects which are registered with this pool.</dd>
</span><spanclass="modifiers">public</span> <spanclass="return-type">@NotNull reactor.core.publisher.Mono<reactor.core.Disposable></span> <spanclass="element-name">queueService</span><wbr><spanclass="parameters">(<ahref="../api/IService.html"title="interface in io.github.simplexdevelopment.api">IService</a> service)</span></div>
<divclass="block">This method is the actual method used to schedule a service.
This will register the service with the scheduler, and then return a <code>Disposable</code> object
encapsulated within a <code>Mono</code>. If <ahref="../api/IService.html#isPeriodic()"><code>IService.isPeriodic()</code></a> returns true, then the service
will be scheduled to run periodically. Otherwise, it will be scheduled to run once.</div>
<dd>A <code>Flux</code> object which contains a collection of <code>Disposable</code> elements,
which can be used to destroy the registered services using <ahref="#stopServices(reactor.core.publisher.Flux)"><code>stopServices(Flux)</code></a>.</dd>
</span><spanclass="modifiers">public</span> <spanclass="return-type">@NotNull reactor.core.publisher.Mono<<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Void.html"title="class or interface in java.lang"class="external-link">Void</a>></span> <spanclass="element-name">stopServices</span><wbr><spanclass="parameters">(@NotNull
<dd><code>disposableThread</code> - A <code>reactor.core.publisher.Flux<reactor.core.Disposable></code> which contains all the services that should be disposed..</dd>
<dt>Returns:</dt>
<dd>A <code>reactor.core.publisher.Mono<<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Void.html"title="class or interface in java.lang"class="external-link">Void</a>></code> object which can be used to stop the services.</dd>
</span><spanclass="modifiers">public</span> <spanclass="return-type">@NotNull reactor.core.publisher.Mono<<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Void.html"title="class or interface in java.lang"class="external-link">Void</a>></span> <spanclass="element-name">stopService</span><wbr><spanclass="parameters">(@NotNull
@NotNull <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html"title="class or interface in java.lang"class="external-link">String</a> service_name,
<divclass="block">This is the method used to stop a service. This will call the relative <code>Disposable.dispose()</code> method
to the <code>Scheduler</code> supplied for this pool. If you are using the <ahref="ReactorBukkitScheduler.html"title="class in io.github.simplexdevelopment.scheduler"><code>ReactorBukkitScheduler</code></a>,
this will cancel the task upstream on the <code>BukkitScheduler</code>.</div>
<dd><code>service_name</code> - The name of the service to stop.</dd>
<dd><code>disposable</code> - A <code>Disposable</code> object which contains the service that should be disposed.</dd>
<dt>Returns:</dt>
<dd>A <code>reactor.core.publisher.Mono<<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Void.html"title="class or interface in java.lang"class="external-link">Void</a>></code> object which can be used to stop the service.</dd>
</span><spanclass="modifiers">public</span> <spanclass="return-type">@NotNull reactor.core.publisher.Mono<<ahref="../api/IService.html"title="interface in io.github.simplexdevelopment.api">IService</a>></span> <spanclass="element-name">getService</span><wbr><spanclass="parameters">(<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html"title="class or interface in java.lang"class="external-link">String</a> service_name)</span></div>
<divclass="block">Gets a service based on the name of the service defined by <ahref="../api/Identifier.html#getName()"><code>Identifier.getName()</code></a>.
This will search the service pool for a service with the same name, and return it.</div>
</span><spanclass="modifiers">public</span> <spanclass="return-type">@NotNull reactor.core.publisher.Mono<<ahref="ServicePool.html"title="class in io.github.simplexdevelopment.scheduler">ServicePool</a>></span> <spanclass="element-name">recycle</span>()</div>
<divclass="member-signature"><spanclass="modifiers">public</span> <spanclass="return-type"><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html"title="class or interface in java.lang"class="external-link">String</a></span> <spanclass="element-name">getName</span>()</div>
<dlclass="notes">
<dt>Specified by:</dt>
<dd><code><ahref="../api/Identifier.html#getName()">getName</a></code> in interface <code><ahref="../api/Identifier.html"title="interface in io.github.simplexdevelopment.api">Identifier</a></code></dd>
<dt>Returns:</dt>
<dd>The name of the identifiable object in a readable format.</dd>