temporalio / sdk-ruby

Temporal Ruby SDK
MIT License
75 stars 7 forks source link

[Feature] Implement a basic Core Worker #27

Closed antstorm closed 2 years ago

antstorm commented 2 years ago

What was changed

This PR adds an implementation of a Core Worker with a method for polling for activity tasks. We're also switching to a single shared Runtime since a Client can not be moved between 2 different types of runtimes.

Why?

The Core Worker will used by a high-level Ruby Worker

Checklist

  1. Closes #7

  2. How was this tested: Tested by compiling running a script locally (unit tests will be added with a Ruby Worker implementation)

  3. Any docs updates needed? No

antstorm commented 2 years ago

@cretz @Sushisource reworked this PR to make the calls non-blocking as discussed. This is now based on the callback passed into the RPC and then executed from a Ruby thread when a response is received.

I tried a few different approached to structuring the code, but nothing felt right, so I'm leaving this in a single worker.rs file for now before I can figure out a good way to split it.