generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9279f9f
commit 82a89a2
Showing
10 changed files
with
51 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
jvm-runtime/ftl-runtime/common/runtime/src/main/java/xyz/block/ftl/ConsumableTopic.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package xyz.block.ftl; | ||
|
||
/** | ||
* Marker interface for a topic that can be subscribed to, it must be extended and annotated with {@code @TopicDefinition}. | ||
*/ | ||
public interface ConsumableTopic { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 13 additions & 8 deletions
21
jvm-runtime/ftl-runtime/common/runtime/src/main/java/xyz/block/ftl/Topic.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
package xyz.block.ftl; | ||
|
||
/** | ||
* A concrete definition of a topic. Extend this interface and annotate with {@code @TopicDefinition} to define a topic, | ||
* then inject this into verb methods to publish to the topic. | ||
* | ||
* @param <T> | ||
*/ | ||
public interface Topic<T> { | ||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.TYPE) | ||
public @interface Topic { | ||
/** | ||
* | ||
* @return The name of the topic | ||
*/ | ||
String value(); | ||
|
||
void publish(T object); | ||
} |
17 changes: 0 additions & 17 deletions
17
jvm-runtime/ftl-runtime/common/runtime/src/main/java/xyz/block/ftl/TopicDefinition.java
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
jvm-runtime/ftl-runtime/common/runtime/src/main/java/xyz/block/ftl/WriteableTopic.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package xyz.block.ftl; | ||
|
||
/** | ||
* A concrete definition of a topic. Extend this interface and annotate with {@code @TopicDefinition} to define a topic, | ||
* then inject this into verb methods to publish to the topic. | ||
* | ||
* @param <T> | ||
*/ | ||
public interface WriteableTopic<T> extends ConsumableTopic { | ||
|
||
void publish(T object); | ||
} |