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

io.quarkus.qe.PriceResource Maven / Gradle / Ivy

There is a newer version: 1.6.0.Beta15
Show newest version
package io.quarkus.qe;

import jakarta.inject.Inject;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;

/**
 * A simple resource retrieving the in-memory "my-data-stream" and sending the items as server-sent events.
 */
@Path("/prices")
public class PriceResource {

    @Inject
    PriceConsumer repository;

    @GET
    @Path("/poll")
    @Produces(MediaType.TEXT_PLAIN)
    public Double get() {
        return repository.getPrices().poll();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy