Skip to content

Commit

Permalink
Added new annotation ExecuteOn
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-v committed Oct 13, 2024
1 parent 07c9b05 commit 7b19401
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package io.scalecube.services.annotations;

import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

/**
* This annotation is used to mark that particular service method or all service methods will be
* executed in the specified scheduler.
*/
@Documented
@Target({METHOD, TYPE})
@Retention(RUNTIME)
public @interface ExecuteOn {

/**
* Returns {@link reactor.core.scheduler.Scheduler} spec, in the format: {@code
* <scheduler_name>:<scheduler_constructor_spec>}
*
* @return scheduler spec
*/
String value();
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/** Indicates that an annotated class is an Service Fabric service object. */
/** Indicates that annotated class is a ScaleCube service object. */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface Service {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.lang.annotation.Target;

/**
* Indicates that an annotated method is a service method available via Service Fabric framework.
* Indicates that annotated method is a ScaleCube service method.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
Expand Down

0 comments on commit 7b19401

Please sign in to comment.