Skip to content
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
7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ version = "0.1.0"
authors = ["Spencer Judge <spencer@temporal.io>", "Vitaly Arbuzov <vitaly@temporal.io>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]

[dependencies]
tonic = "0.3"
async-trait = "0.1"
prost = "0.6"
prost-types = "0.6"
thiserror = "1.0"
tonic = "0.3"

[build-dependencies]
tonic-build = "0.3"
6 changes: 3 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.build_server(false)
.build_client(false)
.compile(
&["protos/core_interface.proto"],
&["protos/api_upstream", "protos"],
&["protos/local/core_interface.proto"],
&["protos/api_upstream", "protos/local"],
)?;
Ok(())
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";

package temporal.api.coresdk.v1;
package coresdk;

// Note: Intellij will think these imports don't work because of the slightly odd nature of
// the include paths. You can make it work by going to the "Protobuf Support" settings section
Expand Down
22 changes: 22 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
pub mod protos;

use protos::coresdk::{PollSdkTaskReq, PollSdkTaskResp};

type Result<T, E = SDKServiceError> = std::result::Result<T, E>;

// TODO: Should probably enforce Send + Sync
#[async_trait::async_trait]
pub trait CoreSDKService {
async fn poll_sdk_task(&self, req: PollSdkTaskReq) -> Result<PollSdkTaskResp>;
}

#[derive(thiserror::Error, Debug)]
pub enum SDKServiceError {
// tbd
}

#[cfg(test)]
mod test {
#[test]
fn foo() {}
}
3 changes: 0 additions & 3 deletions src/main.rs

This file was deleted.

74 changes: 74 additions & 0 deletions src/protos/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
pub mod coresdk {
tonic::include_proto!("coresdk");
}

// This is disgusting, but unclear to me how to avoid it. TODO: Discuss w/ prost maintainer
pub mod temporal {
pub mod api {
pub mod command {
pub mod v1 {
tonic::include_proto!("temporal.api.command.v1");
}
}
pub mod enums {
pub mod v1 {
tonic::include_proto!("temporal.api.enums.v1");
}
}
pub mod failure {
pub mod v1 {
tonic::include_proto!("temporal.api.failure.v1");
}
}
pub mod filter {
pub mod v1 {
tonic::include_proto!("temporal.api.filter.v1");
}
}
pub mod common {
pub mod v1 {
tonic::include_proto!("temporal.api.common.v1");
}
}
pub mod history {
pub mod v1 {
tonic::include_proto!("temporal.api.history.v1");
}
}
pub mod namespace {
pub mod v1 {
tonic::include_proto!("temporal.api.namespace.v1");
}
}
pub mod query {
pub mod v1 {
tonic::include_proto!("temporal.api.query.v1");
}
}
pub mod replication {
pub mod v1 {
tonic::include_proto!("temporal.api.replication.v1");
}
}
pub mod taskqueue {
pub mod v1 {
tonic::include_proto!("temporal.api.taskqueue.v1");
}
}
pub mod version {
pub mod v1 {
tonic::include_proto!("temporal.api.version.v1");
}
}
pub mod workflow {
pub mod v1 {
tonic::include_proto!("temporal.api.workflow.v1");
}
}
pub mod workflowservice {
pub mod v1 {
tonic::include_proto!("temporal.api.workflowservice.v1");
}
}
}
}