net.sf.eBus.timer.package-info Maven / Gradle / Ivy
//
// Copyright 2024 Charles W. Rapp
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
/**
* eBus release 7.3.0 introduces
* {@link net.sf.eBus.timer.EScheduledExecutor} which provides a
* similar functionality as
* {@link java.util.concurrent.ScheduledExecutorService} with the
* difference that expired timer tasks are dispatched to an eBus
* object's task queue. This means timer tasks are processed
* on a eBus dispatcher thread which means the eBus object
* remains effectively single threaded.
* Scheduling Timers
*
* {@code EScheduledExecutor} provides timer scheduling methods
* similar to {@code ScheduledExecutorService}:
*
*
* -
* {@code EScheduledExecutor.schedule(Runnable task, EObject eobject, Duration delay)}
*
* -
* {@code EScheduledExecutor.scheduleAtFixedRate(Runnable task, EObject eobject, Duration initialDelay, Duration period)}
*
* -
* {@code EScheduledExecutor.scheduleWithFixedDelay(Runnable task, EObject eobject, Duration initialDelay, Duration delay)}
*
*
*
* The main difference between Java and eBus schedulers is that
* eBus requires an {@code EObject} argument and eBus does not
* support scheduling a {@link java.util.concurrent.Callable}.
*
* Creating eBus Scheduled Executors
*
* {@link net.sf.eBus.timer.EScheduledExecutor} class
* documentation provides detailed description on how to create a
* new eBus scheduled executor. Like eBus dispatcher threads,
* eBus schedulers come in four flavor: blocking, spinning,
* spin+park, and spin+yield.
*
*
* eBus provides a default, blocking scheduled executor in
* {@link net.sf.eBus.client.EClient#sCoreExecutor}. It is
* strongly recommended that eBus objects use
* {@code EScheduledExecutor} for timed tasks since this
* executor works within the eBus dispatcher framework.
*
*/
package net.sf.eBus.timer;