Skip to content

Commit

Permalink
Clean imports
Browse files Browse the repository at this point in the history
  • Loading branch information
gvdongen committed Nov 22, 2024
1 parent 8569a6e commit 1500e34
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 21 deletions.
30 changes: 15 additions & 15 deletions templates/java-gradle/src/main/java/my/example/Greeter.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@
@Service
public class Greeter {

@Handler
public String greet(Context ctx, String name) {
// Durably execute a set of steps; resilient against failures
String greetingId = ctx.random().nextUUID().toString();
ctx.run(() -> sendNotification(greetingId, name));
ctx.sleep(Duration.ofMillis(1000));
ctx.run(() -> sendReminder(greetingId));
@Handler
public String greet(Context ctx, String name) {
// Durably execute a set of steps; resilient against failures
String greetingId = ctx.random().nextUUID().toString();
ctx.run(() -> sendNotification(greetingId, name));
ctx.sleep(Duration.ofMillis(1000));
ctx.run(() -> sendReminder(greetingId));

// Respond to caller
return "You said hi to " + name + "!";
}
// Respond to caller
return "You said hi to " + name + "!";
}

public static void main(String[] args) {
RestateHttpEndpointBuilder.builder()
.bind(new Greeter())
.buildAndListen();
}
public static void main(String[] args) {
RestateHttpEndpointBuilder.builder()
.bind(new Greeter())
.buildAndListen();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
import static com.example.restatestarter.Utils.sendNotification;
import static com.example.restatestarter.Utils.sendReminder;

/**
* Template of a Restate service and handler.
*/
@RestateService
public class Greeter {

Expand Down
5 changes: 2 additions & 3 deletions templates/rust-shuttle/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
use std::time::Duration;
use restate_sdk::prelude::*;

// Restate shuttle integration
mod restate_shuttle;
mod utils;

use restate_sdk::prelude::*;
use restate_shuttle::RestateShuttleEndpoint;
use utils::{send_notification, send_reminder};
use std::time::Duration;

#[restate_sdk::service]
trait Greeter {
Expand Down

0 comments on commit 1500e34

Please sign in to comment.