Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
- Fix code examples.
  • Loading branch information
batiati authored Sep 30, 2022
1 parent a56fe80 commit 6be0225
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ All TigerBeetle's IDs are 128-bit unsigned integers that can be represented as a

```java
import com.tigerbeetle.Client;
import com.tigerbeetle.Accounts;
import com.tigerbeetle.CreateAccountResults;
import com.tigerbeetle.AccountBatch;
import com.tigerbeetle.CreateAccountResultBatch;

// ...

Expand All @@ -54,7 +54,7 @@ while(errors.next()) {

switch (accountErrors.getResult()) {

Exists:
case Exists:
System.err.printf("Account at %d already exists.\n",
errors.getIndex());
break;
Expand All @@ -77,8 +77,9 @@ Amounts are 64-bit unsigned integers values.

```java
import com.tigerbeetle.Client;
import com.tigerbeetle.Transfers;
import com.tigerbeetle.CreateTransferResults;
import com.tigerbeetle.TransferBatch;
import com.tigerbeetle.CreateTransferResultBatch;
import java.util.concurrent.CompletableFuture;

// ...

Expand All @@ -90,15 +91,15 @@ transfers.add();
transfers.setId(id);
transfers.setCreditAccountId(creditAccountId);
transfers.setDebitAccountId(debitAccountId);
transfers.setCode(1);
transfers.setCode(3001);
transfers.setLedger(720);
transfers.setAmount(100);

// Async usage:
// Submit the batch and returns immediately
CompletableFuture<CreateTransferResultBatch> request = client.createTransfersAsync(transfers);

// Register something on the application's side while tigerbeetle is processing
// Register something on the application's side while TigerBeetle is processing
// UPDATE MyCustomer ...

// Gets the reply
Expand All @@ -109,7 +110,7 @@ while(errors.next()) {

switch (accountErrors.getResult()) {

ExceedsCredits:
case ExceedsCredits:
System.err.printf("Transfer at %d exceeds credits.\n",
errors.getIndex());
break;
Expand Down

0 comments on commit 6be0225

Please sign in to comment.