Skip to content

Added a functional interface EventLoopSchedulerFactory#5323

Open
LaylaSilbernberg wants to merge 4 commits into
line:mainfrom
LaylaSilbernberg:event-loop-scheduler-factory-branch
Open

Added a functional interface EventLoopSchedulerFactory#5323
LaylaSilbernberg wants to merge 4 commits into
line:mainfrom
LaylaSilbernberg:event-loop-scheduler-factory-branch

Conversation

@LaylaSilbernberg

Copy link
Copy Markdown

Motivation:

Issue #5289 outlines how the current Event Loop Scheduler factory method may not be enough to create more sophisticated Event Loop Schedulers. I seek to address this by adding a more generalized factory method as requested.

Modifications:

  • Added a functional interface for an Event Loop Scheduler Factory method that takes the follow parameters:
    • EventLoopGroup eventLoopGroup
    • List<ToIntFunction> maxNumEventLoopsFunctions
    • int maxNumEventLoopsPerEndpoint
    • int maxNumEventLoopsPerHttp1Endpoint
    • long idleTimeoutMillis

Result:

@CLAassistant

CLAassistant commented Dec 4, 2023

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

import java.util.function.ToIntFunction;

@FunctionalInterface
public interface EventLoopSchedulerFactory {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you deprecate the following API and add a new API using this interface?

public ClientFactoryBuilder eventLoopSchedulerFactory(
Function<? super EventLoopGroup, ? extends EventLoopScheduler> eventLoopSchedulerFactory) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! Yes, that should be no problem. What does the deprecation process look like?

@LaylaSilbernberg

Copy link
Copy Markdown
Author

Modifications:

  • Added a functional interface for an Event Loop Scheduler Factory method that takes the follow parameters:
    • EventLoopGroup eventLoopGroup
    • List<ToIntFunction> maxNumEventLoopsFunctions
    • int maxNumEventLoopsPerEndpoint
    • int maxNumEventLoopsPerHttp1Endpoint
    • long idleTimeoutMillis
  • Added a new API for building an Event Loop Scheduler using the new interface.
  • Deprecated the old API for lacking the ability to create more sophisticated schedulers.

Result:

  • Closes Add EventLoopSchedulerFactory #5289
  • (Deprecated) The old eventLoopSchedulerFactory API has been deprecated.
    • You can instead use the new eventLoopSchedulerFactory API in the ClientFactoryBuilder, which uses the above-mentioned interface, to create more sophisticated EventLoopSchedulers.

…cheduler-factory-branch

# Conflicts:
#	core/src/main/java/com/linecorp/armeria/client/EventLoopSchedulerFactory.java
@LaylaSilbernberg
LaylaSilbernberg force-pushed the event-loop-scheduler-factory-branch branch from 44eed76 to 4776e64 Compare January 18, 2024 12:43
@LaylaSilbernberg

Copy link
Copy Markdown
Author

Rolled things back, updated the project, added the changes. I don't know what happened that made the previous update so polluted.

@github-actions github-actions Bot added the Stale label Apr 9, 2024
@@ -0,0 +1,15 @@
package com.linecorp.armeria.client;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing copyright

public static final ClientFactoryOption<EventLoopGroup> WORKER_GROUP =
ClientFactoryOption.define("WORKER_GROUP", CommonPools.workerGroup());

/**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you revert the changes in this file? It's hard to recognize which one is modified.

@github-actions github-actions Bot removed the Stale label May 14, 2024
@github-actions github-actions Bot added the Stale label Jun 13, 2024
@minwoox minwoox added this to the 1.33.0 milestone Feb 11, 2025
@github-actions github-actions Bot removed the Stale label Feb 17, 2025
@github-actions github-actions Bot added the Stale label May 4, 2025
@ikhoon ikhoon modified the milestones: 1.33.0, 1.34.0 Aug 1, 2025
@github-actions github-actions Bot removed the Stale label Aug 11, 2025
@github-actions github-actions Bot added the Stale label Oct 20, 2025
@jrhee17 jrhee17 modified the milestones: 1.34.0, 1.35.0 Nov 24, 2025
@github-actions github-actions Bot removed the Stale label Nov 30, 2025
@minwoox minwoox modified the milestones: 1.35.0, 1.36.0 Dec 30, 2025
@ikhoon ikhoon modified the milestones: 1.36.0, 1.37.0 Feb 2, 2026
@ikhoon ikhoon modified the milestones: 1.38.0, 2.0.0, 1.39.0 Apr 3, 2026
@minwoox minwoox modified the milestones: 1.39.0, 1.40.0 May 8, 2026
@jrhee17 jrhee17 modified the milestones: 1.40.0, 1.41.0 Jun 10, 2026
@github-actions github-actions Bot added the Stale label Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add EventLoopSchedulerFactory

5 participants