alain 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/alain/templates/integration_test.rs.erb +1 -3
- data/lib/alain/templates/mod.rs.erb +4 -2
- data/lib/alain/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 912beb23f7468f0b5307cdee90ed2bd569238fedf00de552bc597faafd6ae6b2
|
4
|
+
data.tar.gz: 727a75d4a7a0d42bab65f2f9a9898365287441cacbd17a0274023828f775da6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57b42c450f77c67381a833ffdda35312fc77b30e0c1150c126dd397a3882f5a9481171ce1e5404556730b2cbcd3b616a0ce6a90491860c9d356c083b73dc71e8
|
7
|
+
data.tar.gz: e5397ec33b798b45298856724c1442d7ed1243975239e67f080823e416a1c4050b72b988886ec4d1ae3c0f66f2f757318ba5c88bddb3c5dae8cc6aff74c66a29
|
@@ -1,14 +1,12 @@
|
|
1
1
|
mod common;
|
2
2
|
use common::setup;
|
3
|
-
use triggered::trigger;
|
4
3
|
|
5
4
|
<%= proto.use_def(cargo.crate_name) %>
|
6
5
|
use <%= cargo.crate_name %>::<%= proto.package %>::<%= proto.service_name(:snake) %>_client::<%= proto.service_name %>Client;
|
7
6
|
|
8
7
|
#[tokio::test]
|
9
8
|
async fn it_returns_ok_response() {
|
10
|
-
let (
|
11
|
-
let (jh, channel) = setup(shutdown_signal).await.unwrap();
|
9
|
+
let (jh, channel, shutdown_trigger) = setup().await.unwrap();
|
12
10
|
|
13
11
|
let mut client = <%= proto.service_name %>Client::new(channel);
|
14
12
|
// TODO: implement gRPC client request
|
@@ -2,9 +2,11 @@
|
|
2
2
|
use std::time::Duration;
|
3
3
|
use tokio::task::JoinHandle;
|
4
4
|
use tonic::{transport::Channel, Status};
|
5
|
+
use triggered::{trigger, Trigger};
|
5
6
|
use <%= cargo.crate_name %>::create_router;
|
6
7
|
|
7
|
-
pub async fn setup(
|
8
|
+
pub async fn setup() -> Result<(JoinHandle<()>, Channel, Trigger), Box<dyn std::error::Error>> {
|
9
|
+
let (shutdown_trigger, signal) = trigger();
|
8
10
|
let srv: JoinHandle<()> = tokio::spawn(async move {
|
9
11
|
// Launch gRPC server
|
10
12
|
create_router().await
|
@@ -21,5 +23,5 @@ pub async fn setup(signal: triggered::Listener) -> Result<(JoinHandle<()>, Chann
|
|
21
23
|
.connect_lazy()
|
22
24
|
.or_else(|_e| Err(Status::cancelled("client connection error")))?;
|
23
25
|
|
24
|
-
Ok((srv, channel))
|
26
|
+
Ok((srv, channel, shutdown_trigger))
|
25
27
|
}
|
data/lib/alain/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chuma Takahiro
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tomlrb
|