Code example for ThreadFactoryBuilder

    public FiberExecutorScheduler(String name, Executor executor, MonitorType monitorType, boolean detailedInfo) {
        super(name, monitorType, detailedInfo);
        this.executor = executor;
        this.timer = new FiberTimedScheduler(this,
                new ThreadFactoryBuilder().setDaemon(true).setNameFormat("FiberTimedScheduler-" + getName()).build(),
     * Creates a new fiber scheduler with no monitor. 
     * @param name     the scheuler's name. This name is used in naming the scheduler's threads. 
     * @param executor an {@link Executor} used to schedule the fibers; 
     *                 may be {@code null} if the {@link #execute(Runnable)} method is overriden. 
    public FiberExecutorScheduler(String name, Executor executor) {
        this(name, executor, null, false);
Experience pair programming with AI  Get Codota for Java