Skip to content

Commit 1355f62

Browse files
authored
[Docs] Update README for the Client release (#68)
* Update README for the Client release * Remove http: from URL in README * Add a not on TLS support
1 parent f91559f commit 1355f62

File tree

1 file changed

+84
-5
lines changed

1 file changed

+84
-5
lines changed

README.md

Lines changed: 84 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,94 @@
11
# Temporal Ruby SDK
22

3-
![CI status](https://github.com/temporalio/sdk-ruby/actions/workflows/ci.yml/badge.svg?branch=main)
3+
[![CI status](https://github.com/temporalio/sdk-ruby/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/temporalio/sdk-ruby/actions/workflows/ci.yml?query=branch%3Amain)
4+
[![Build](https://github.com/temporalio/sdk-ruby/actions/workflows/build-native-ext.yml/badge.svg)](https://github.com/temporalio/sdk-ruby/actions/workflows/build-native-ext.yml?query=branch%3Amain+event%3Arelease)
5+
[![Gem Version](https://badge.fury.io/rb/temporalio.svg)](https://rubygems.org/gems/temporalio)
46

5-
Temporal is a distributed, scalable, durable, and highly available orchestration engine used to
6-
execute asynchronous long-running business logic in a scalable and resilient way.
7+
[Temporal](https://temporal.io/) is a distributed, scalable, durable, and highly available
8+
orchestration engine used to execute asynchronous long-running business logic in a scalable and
9+
resilient way.
710

811
"Temporal Ruby SDK" is the framework for authoring workflows and activities using the Ruby
912
programming language.
1013

1114
⚠️ UNDER DEVELOPMENT
1215

16+
The Ruby SDK is under development. There are no compatibility guarantees at this time.
17+
18+
At this point the SDK only supports the **Temporal Client** capabilities:
19+
20+
- Starting a workflow (defined in any other SDK)
21+
- Interacting with a workflow (cancelling, querying, signalling, etc)
22+
- Interceptor and Data Conversion support
23+
- gRPC access to Temporal Server
24+
- Temporal Cloud is not yet supported due to the lack of TLS support, but it's coming soon
25+
26+
27+
## Quick Start
28+
29+
### Installation
30+
31+
Add the [`temporalio` gem](https://rubygems.org/gems/temporalio) to your Gemfile:
32+
33+
```ruby
34+
gem 'temporalio'
35+
```
36+
37+
The SDK is now ready for use. To build from source, see [Dev Setup](#dev-setup).
38+
39+
**NOTE: This README is for the current branch and not necessarily what's released on RubyGems.**
40+
41+
42+
## Usage
43+
44+
### Client
45+
46+
A client can be created and used to start a workflow like so:
47+
48+
```ruby
49+
# Establish a gRPC connection to the server
50+
connection = Temporal::Connection.new('localhost:7233')
51+
52+
# Initialize a Client with a namespace
53+
client = Temporal::Client.new(connection, 'my-namespace')
54+
55+
# Start a workflow
56+
handle = client.start_workflow('MyWorkflow', 'some input', id: 'my-id', task_queue: 'my-task-queue')
57+
58+
# Wait for the workflow to finish processing
59+
result = handle.result
60+
puts "Result: #{result}"
61+
```
62+
63+
Some things to note about the above code:
64+
65+
- A `Client` does not have an explicit "close"
66+
- TLS is not yet supported
67+
- All positional arguments after the workflow name are treated as workflow arguments
68+
- The `handle` represents the workflow that was started and can be used for more than just getting
69+
the result
70+
- Clients can have many more options not shown here (e.g. data converters and interceptors)
71+
72+
### Data Conversion
73+
74+
Data converters are used to convert raw Temporal payloads to/from actual Ruby types. These consist
75+
of 3 distinct types of converters:
76+
77+
- **Payload Converters** to convert Ruby values to/from serialized bytes
78+
- **Payload Codecs** to convert bytes to bytes (e.g. for compression or encryption)
79+
- **Failure Converters** to convert exceptions to/from serialized failures
80+
81+
The default data converter supports converting multiple types including:
82+
83+
- `nil`
84+
- bytes (`String` with `Encoding::ASCII_8BIT`)
85+
- Anything that [`JSON.generate`](https://ruby-doc.org/stdlib-3.0.0/libdoc/json/rdoc/JSON.html#method-i-generate)
86+
supports
87+
88+
This notably doesn't include any `Date`, `Time`, or `DateTime` objects as they may not work across
89+
different SDKs. A custom payload converter can be implemented to support these.
90+
91+
1392
## Dev Setup
1493

1594
Once you've forked/cloned the repository you want to make sure all the submodules are fetched as
@@ -41,11 +120,11 @@ Now you should be able to compile a dev build of the Bridge:
41120
You can then run all the specs against a dev build using:
42121

43122
```sh
44-
> DEBUG=true bundle exec rspec
123+
> bundle exec rspec
45124
```
46125

47126
And open an IRB session using:
48127

49128
```sh
50-
> DEBUG=true bundle console
129+
> bundle console
51130
```

0 commit comments

Comments
 (0)