Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove echo from quickstart #4817

Merged
merged 1 commit into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions docs/docs/getting-started/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ import (
)

//ftl:verb
func Echo(ctx context.Context, name ftl.Option[string]) (string, error) {
func Hello(ctx context.Context, name ftl.Option[string]) (string, error) {
return fmt.Sprintf("Hello, %s!", name.Default("anonymous")), nil
}
```
Expand Down Expand Up @@ -148,7 +148,7 @@ When you create a new module, FTL generates a schema that represents your code.

```schema
module alice {
verb echo(String?) String
verb hello(String?) String
}
```

Expand Down Expand Up @@ -189,7 +189,7 @@ And view your trace in the console:

### Create another module

Create another module and call `alice.echo` from it with by importing the `alice` module and adding the verb client, `alice.EchoClient`, to the signature of the calling verb. It can be invoked as a function:
Create another module and call `alice.hello` from it with by importing the `alice` module and adding the verb client, `alice.HelloClient`, to the signature of the calling verb. It can be invoked as a function:

<Tabs groupId="languages">
<TabItem value="go" label="Go" default>
Expand All @@ -199,7 +199,7 @@ Create another module and call `alice.echo` from it with by importing the `alice
import "ftl/alice"

//ftl:verb
func Other(ctx context.Context, in string, ec alice.EchoClient) (string, error) {
func Other(ctx context.Context, in string, ec alice.HelloClient) (string, error) {
out, err := ec(ctx, in)
...
}
Expand All @@ -213,15 +213,15 @@ package com.example

import xyz.block.ftl.Export
import xyz.block.ftl.Verb
import ftl.alice.EchoClient
import ftl.alice.Hellolient


@Export
@Verb
fun other(req: String, echo: EchoClient): String = "Hello from Other , ${echo.call(req)}!"
fun other(req: String, hello: HelloClient): String = "Hello from Other , ${hello.call(req)}!"
```

Note that the `EchoClient` is generated by FTL and must be imported. Unfortunately at the moment JVM based languages have a bit of a chicken-and-egg problem with the generated clients. To force a dependency between the modules you need to add an import on a class that does not exist yet, and then FTL will generate the client for you. This will be fixed in the future.
Note that the `HelloClient` is generated by FTL and must be imported.

</TabItem>
<TabItem value="java" label="Java">
Expand All @@ -231,19 +231,19 @@ package com.example.client;

import xyz.block.ftl.Export;
import xyz.block.ftl.Verb;
import ftl.alice.EchoClient;
import ftl.alice.HelloClient;

public class OtherVerb {

@Export
@Verb
public String other(String request, EchoClient echoClient) {
return "Hello, " + echoClient.call(request) + "!";
public String other(String request, HelloClient helloClient) {
return "Hello, " + helloClient.call(request) + "!";
}
}
```

Note that the `EchoClient` is generated by FTL and must be imported. Unfortunately at the moment JVM based languages have a bit of a chicken-and-egg problem with the generated clients. To force a dependency between the modules you need to add an import on a class that does not exist yet, and then FTL will generate the client for you. This will be fixed in the future.
Note that the `HelloClient` is generated by FTL and must be imported.

</TabItem>
<TabItem value="schema" label="Schema">
Expand All @@ -252,16 +252,16 @@ When you create a second module that calls the first one, the schema would look

```schema
module alice {
export verb echo(String?) String
export verb hello(String?) String
}

module other {
export verb other(String) String
+calls alice.echo
+calls alice.hello
}
```

The `+calls` annotation in the schema indicates that the `other` verb calls the `echo` verb from the `alice` module.
The `+calls` annotation in the schema indicates that the `other` verb calls the `hello` verb from the `alice` module.

</TabItem>
</Tabs>
Binary file modified docs/static/img/quick-start/consolecall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/static/img/quick-start/consoletrace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/static/img/quick-start/ftlcall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading