Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support an alias for a bunch of annotations #1224

Closed
hyangtack opened this issue May 24, 2018 · 0 comments
Closed

Support an alias for a bunch of annotations #1224

hyangtack opened this issue May 24, 2018 · 0 comments
Assignees

Comments

@hyangtack
Copy link
Contributor

Example
Define an alias annotation like below:

@ProduceJson
@LoggingDecorator(...)
@interface CategoryX {}

Use the alias like below:

@CategoryX
@Get(...)
public void ... {}
hyangtack added a commit to hyangtack/armeria that referenced this issue Jan 23, 2019
Motivation:
Server-sent Events (SSE) is an HTTP standard that allows a web application to handle a unidirectional event stream. So it would be useful if we provide a streaming response converter for the events.

Modifications:
- Add `MediaType#EVENT_STREAM` for `text/event-stream` and `@ProducesEventStream` as an alias for `@Produces("text/event-stream")`.
- Add `ServerSentEvent` interface and its builder `ServerSentEventBuilder` to support emitting events.
- Add a response converter for SSE, which supports `Publisher<ServerSentEvent>` and `Stream<ServerSentEvent>`.

Result:
- SSE streaming support
- Closes line#1522

Limitation:
- Currently, a user need to specify both `@ProducesEventStream` and `@ResponseConverter(ServerSentEventResponseConverterFunction.class)` to enable this feature. After the issue line#1224 is resolved, it would be simplified.
@hyangtack hyangtack self-assigned this Jan 23, 2019
hyangtack added a commit to hyangtack/armeria that referenced this issue Jan 29, 2019
Motivation:
Server-sent Events (SSE) is an HTTP standard that allows a web application to handle a unidirectional event stream. So it would be useful if we provide a streaming response converter for the events.

Modifications:
- Add `MediaType#EVENT_STREAM` for `text/event-stream` and `@ProducesEventStream` as an alias for `@Produces("text/event-stream")`.
- Add `ServerSentEvent` interface and its builder `ServerSentEventBuilder` to support emitting events.
- Add a response converter for SSE, which supports `Publisher<ServerSentEvent>` and `Stream<ServerSentEvent>`.

Result:
- SSE streaming support
- Closes line#1522

Limitation:
- Currently, a user need to specify both `@ProducesEventStream` and `@ResponseConverter(ServerSentEventResponseConverterFunction.class)` to enable this feature. After the issue line#1224 is resolved, it would be simplified.
hyangtack added a commit to hyangtack/armeria that referenced this issue Jan 30, 2019
Motivation:
Server-sent Events (SSE) is an HTTP standard that allows a web application to handle a unidirectional event stream. So it would be useful if we provide a streaming response converter for the events.

Modifications:
- Add `MediaType#EVENT_STREAM` for `text/event-stream` and `@ProducesEventStream` as an alias for `@Produces("text/event-stream")`.
- Add `ServerSentEvent` interface and its builder `ServerSentEventBuilder` to support emitting events.
- Add a response converter for SSE, which supports `Publisher<ServerSentEvent>` and `Stream<ServerSentEvent>`.
- Add utility classes named `JsonTextSequences` and `ServerSentEvents` for non-annotated services.

Result:
- SSE streaming support
- Closes line#1522

Limitation:
- Currently, a user need to specify both `@ProducesEventStream` and `@ResponseConverter(ServerSentEventResponseConverterFunction.class)` to enable this feature. After the issue line#1224 is resolved, it would be simplified.
hyangtack added a commit to hyangtack/armeria that referenced this issue Jan 30, 2019
Motivation:
Server-sent Events (SSE) is an HTTP standard that allows a web application to handle a unidirectional event stream. So it would be useful if we provide a streaming response converter for the events.

Modifications:
- Add `MediaType#EVENT_STREAM` for `text/event-stream` and `@ProducesEventStream` as an alias for `@Produces("text/event-stream")`.
- Add `ServerSentEvent` interface and its builder `ServerSentEventBuilder` to support emitting events.
- Add a response converter for SSE, which supports `Publisher<ServerSentEvent>` and `Stream<ServerSentEvent>`.
- Add utility classes named `JsonTextSequences` and `ServerSentEvents` for non-annotated services.

Result:
- SSE streaming support
- Closes line#1522

Limitation:
- Currently, a user need to specify both `@ProducesEventStream` and `@ResponseConverter(ServerSentEventResponseConverterFunction.class)` to enable this feature. After the issue line#1224 is resolved, it would be simplified.
hyangtack added a commit to hyangtack/armeria that referenced this issue Jan 31, 2019
Motivation:
Server-sent Events (SSE) is an HTTP standard that allows a web application to handle a unidirectional event stream. So it would be useful if we provide a streaming response converter for the events.

Modifications:
- Add `MediaType#EVENT_STREAM` for `text/event-stream` and `@ProducesEventStream` as an alias for `@Produces("text/event-stream")`.
- Add `ServerSentEvent` interface and its builder `ServerSentEventBuilder` to support emitting events.
- Add a response converter for SSE, which supports `Publisher<ServerSentEvent>` and `Stream<ServerSentEvent>`.
- Add utility classes named `JsonTextSequences` and `ServerSentEvents` for non-annotated services.

Result:
- SSE streaming support
- Closes line#1522

Limitation:
- Currently, a user need to specify both `@ProducesEventStream` and `@ResponseConverter(ServerSentEventResponseConverterFunction.class)` to enable this feature. After the issue line#1224 is resolved, it would be simplified.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants