This file contains hidden or 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
package com.hello.controllerthread; | |
import io.micronaut.http.annotation.Controller; | |
import io.micronaut.http.annotation.Get; | |
import io.reactivex.Single; | |
import java.util.Map; | |
@Controller("/thread") | |
public class ThreadEndpoint |
This file contains hidden or 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
package com.hello; | |
import io.reactivex.Observable; | |
import io.reactivex.disposables.Disposable; | |
import io.reactivex.observables.ConnectableObservable; | |
/** | |
* Lesson learned: It is not the Observable that is disposed, it is the Observer | |
* that may get disposed. Rx's API and documentation continuously describe | |
* the Observable as the one being disposed, but this is wrong. |
This file contains hidden or 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
class DefaultFacade implements Facade | |
{ | |
@Inject | |
OrderService service; | |
@Override | |
public void buttonClicked() { | |
Instant dispatch = Instant.now().plus(2, ChronoUnit.HOURS); | |
Order order = service.createOrder(dispatch); | |
// .. |
This file contains hidden or 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
apply plugin: 'java' | |
apply plugin: 'java-library-distribution' | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
compile 'org.apache.commons:commons-lang3:3.3.2' | |
} |