All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.neko233.toolchain.actor.strategy.ActorIdStrategyFactory Maven / Gradle / Ivy

package com.neko233.toolchain.actor.strategy;


/**
 * @author SolarisNeko on 2023-02-05
 **/
public interface ActorIdStrategyFactory {

    static ActorIdStrategy choose(String name) {
        // sharding
        if (ActorIdStrategyConstant.SHARDING.equalsIgnoreCase(name)) {
            return ShardingActorIdStrategy.singleton;
        }
        // load balance
        if (ActorIdStrategyConstant.LOAD_BALANCE.equalsIgnoreCase(name)) {
            return LoadBalanceActorIdStrategy.singleton;
        }

        // (default) sharding
        return ShardingActorIdStrategy.singleton;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy