Skip to content

Commit

Permalink
Updated readme with Blocking annotation info.
Browse files Browse the repository at this point in the history
  • Loading branch information
noboomu committed Mar 23, 2018
1 parent 793f557 commit c3d5c82
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Prior to calling `start` on the `ProteusApplication` instance:

Out of the box you get a [Swagger UI](https://github.com/swagger-api/swagger-ui) at `/swagger` and [Redoc](https://github.com/Rebilly/ReDoc) at `/swagger/redoc`.

> A `Service` extends `com.google.common.util.concurrent.AbstractIdleService` or `io.sinistral.proteus.servicesBaseService`.
> A `Service` extends `com.google.common.util.concurrent.AbstractIdleService` or `io.sinistral.proteus.services.BaseService`.
> A `Module` implements `com.google.inject.Module`.
Expand Down Expand Up @@ -102,17 +102,20 @@ public class Examples
```


## Controller Classes
### Annotations
##### Class
# Controllers

### Controller Class Annotations
---
Controller classes respect standard Swagger / JAX-RS annotations:
```java
@Api(tags="benchmarks")
@Path("/benchmarks")
@Produces((MediaType.APPLICATION_JSON))
@Consumes((MediaType.MEDIA_TYPE_WILDCARD))
```
##### Method

### Controller Method Annotations
---
Controller class methods also respect standard Swagger / JAX-RS annotations:
```java
@GET
Expand All @@ -124,9 +127,10 @@ public void plaintext(HttpServerExchange exchange)
response("Hello, World!").contentType(PLAINTEXT_TYPE).send(exchange);
}
```
In addition, the `io.sinistral.proteus.annotations.Blocking` annotation can be used to explicitly mark a method for blocked request handling.

### Return Types

## Return Types
---
##### HttpServerExchange = Total Control

For total control and maximum performance the raw `HttpServerExchange` can be passed to the controller method.
Expand Down Expand Up @@ -198,6 +202,7 @@ public void handleRequest(final io.undertow.server.HttpServerExchange exchange)
```

### Arguments
---
A ```io.sinistral.proteus.server.ServerRequest``` can be added as an endpoint argument if the user wishes to access request properties that are not included in the argument list.

Proteus is capable of parsing most types of endpoint arguments automatically so long as the type has a ```fromString```, ```valueOf```, or can be deserialized from JSON.
Expand Down Expand Up @@ -244,8 +249,10 @@ public ServerResponse<Map<String,Object>> complexParameters(
}
```
## Services
---
Proteus comes with two standard services that extend the ```io.sinistral.proteus.services.BaseService``` class.
##### AssetsService
#### AssetsService
---
The AssetsService mounts an asset directory at a given path and is configured in your ```application.conf``` file.

The default configuration:
Expand All @@ -261,7 +268,8 @@ assets {
}
}
```
##### SwaggerService
#### SwaggerService
---
The SwaggerService generates a swagger-spec file from your endpoints and serves a swagger-ui and spec.

The service is configured in your ```application.conf``` file.
Expand Down Expand Up @@ -294,13 +302,16 @@ swagger {
schemes = ["http"]
}
```

---
## Getting Started
COMING SOON


---

## Examples
COMING SOON

---

### Dependencies

Expand Down

0 comments on commit c3d5c82

Please sign in to comment.