Java Code Examples for org.eclipse.microprofile.reactive.messaging.Emitter

The following examples show how to use org.eclipse.microprofile.reactive.messaging.Emitter. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@SuppressWarnings("rawtypes")
private Emitter getEmitter(InjectionPoint injectionPoint) {
    String name = getChannelName(injectionPoint);
    Emitter emitter = channelRegistry.getEmitter(name);
    if (emitter == null) {
        throw ex.illegalStateForEmitter(name, channelRegistry.getEmitterNames());
    }
    return emitter;
}
 
Example 2
@Override
public synchronized void register(String name, Emitter<?> emitter) {
    Objects.requireNonNull(name, msg.nameMustBeSet());
    Objects.requireNonNull(emitter, msg.emitterMustBeSet());
    emitters.put(name, emitter);
}
 
Example 3
@Override
public synchronized Emitter<?> getEmitter(String name) {
    Objects.requireNonNull(name, msg.nameMustBeSet());
    return emitters.get(name);
}
 
Example 4
public Emitter<String> emitter() {
    return emitter;
}
 
Example 5
Source Project: smallrye-reactive-messaging   Source File: EmitterBean.java    License: Apache License 2.0 4 votes vote down vote up
public Emitter<String> emitter() {
    return emitter;
}
 
Example 6
public Emitter<String> emitter() {
    return emitter;
}
 
Example 7
public Emitter<Message<String>> emitter() {
    return emitter;
}
 
Example 8
public Emitter<String> emitter() {
    return emitter;
}
 
Example 9
public Emitter<String> emitter() {
    return emitter;
}
 
Example 10
public Emitter<String> emitter() {
    return emitter;
}
 
Example 11
public Emitter<String> emitter() {
    return emitter;
}
 
Example 12
public Emitter<String> emitter() {
    return emitter;
}
 
Example 13
public Emitter<String> emitter() {
    return emitter;
}
 
Example 14
public Emitter<String> emitter() {
    return emitter;
}
 
Example 15
Source Project: quarkus   Source File: ChannelEmitterWithOverflow.java    License: Apache License 2.0 4 votes vote down vote up
@Inject
public void setEmitter(@Channel("sink-1") Emitter<String> sink1,
        @Channel("sink-2") @OnOverflow(value = OnOverflow.Strategy.BUFFER, bufferSize = 4) Emitter<String> sink2) {
    this.emitterForSink1 = sink1;
    this.emitterForSink2 = sink2;
}
 
Example 16
@Inject
public void setEmitter(@Channel("sink-1") @Broadcast Emitter<String> sink1,
        @Channel("sink-2") @Broadcast @OnOverflow(value = OnOverflow.Strategy.BUFFER, bufferSize = 4) Emitter<String> sink2) {
    this.emitterForSink1 = sink1;
    this.emitterForSink2 = sink2;
}
 
Example 17
/**
 * Injects an {@link Emitter} matching the channel name.
 *
 * @param injectionPoint the injection point
 * @param <T> the type of the emitter
 * @return the emitter
 */
@Produces
@Channel("") // Stream name is ignored during type-safe resolution
<T> Emitter<T> produceEmitter(InjectionPoint injectionPoint) {
    Emitter emitter = getEmitter(injectionPoint);
    return cast(emitter);
}
 
Example 18
/**
 * Injects an {@link io.smallrye.reactive.messaging.annotations.Emitter} (deprecated) matching the channel name.
 *
 * @param injectionPoint the injection point
 * @param <T> the type
 * @return the legacy emitter
 * @deprecated Use the new {@link Emitter} and {@link Channel} instead
 */
@Produces
@io.smallrye.reactive.messaging.annotations.Channel("") // Stream name is ignored during type-safe resolution
<T> io.smallrye.reactive.messaging.annotations.Emitter<T> produceEmitterLegacy(
        InjectionPoint injectionPoint) {
    LegacyEmitterImpl emitter = new LegacyEmitterImpl(getEmitter(injectionPoint));
    return cast(emitter);
}
 
Example 19
void register(String name, Emitter<?> emitter); 
Example 20
Emitter<?> getEmitter(String name);