3 ms·
The article is pretty naive. It writes code against the low level API which was never intended for workflow writers and then complains that it is too complicate
by mfateev 6y ago
The article is pretty naive. It writes code against the low level API which was never intended for workflow writers and then complains that it is too complicated. He had to use the high level library (https://docs.aws.amazon.com/amazonswf/latest/awsrbflowguide/cmd-aws-flow-ruby.html https://docs.aws.amazon.com/amazonswf/latest/awsrbflowguide/...) instead.
It is like writing assembler code against raw Linux kernel systems calls while Python is available and complaining that Linux is too hard to use.
Look at the temporal.io samples which give you completely different view of how such code should look like. For example the money transfer sample (taken from https://github.com/temporalio/java-samples/blob/master/src/main/java/io/temporal/samples/moneytransfer/AccountTransferWorkflowImpl.java https://github.com/temporalio/java-samples/blob/master/src/m...):
```
public class AccountTransferWorkflowImpl implements AccountTransferWorkflow {
private final ActivityOptions options =
ActivityOptions.newBuilder().setStartToCloseTimeout(Duration.ofSeconds(5)).build();
private final Account account = Workflow.newActivityStub(Account.class, options);
@Override
public void transfer(
String fromAccountId, String toAccountId, String referenceId, int amountCents) {
account.withdraw(fromAccountId, referenceId, amountCents);
account.deposit(toAccountId, referenceId, amountCents);
}
}
```