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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2258204c9570c55c8463e4350f60ae595f520fa823cb58fd9586972e92881152
4
- data.tar.gz: 65913bb80b6aa032956d9f2c512dacde20c457890fda5cb6b37127ecc258c34e
3
+ metadata.gz: 912beb23f7468f0b5307cdee90ed2bd569238fedf00de552bc597faafd6ae6b2
4
+ data.tar.gz: 727a75d4a7a0d42bab65f2f9a9898365287441cacbd17a0274023828f775da6f
5
5
  SHA512:
6
- metadata.gz: 7d97170893f926eeb535ba3c2938d3b4e3d80d9e139a4d88fdf9506caac07a42ad0dcc90a85341b46aac6098ea82c52f038e7097f8f1be396258e63611b625b6
7
- data.tar.gz: 7767de8e88ce7da1d8aca3a88e2acef7e4b57f4387aa77378fe16e1623cfc4ca94629230bf5e600f3d32cbc1ddcb1d80ef09834a432bf4ea056342c97af60eb3
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 (shutdown_trigger, shutdown_signal) = trigger();
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(signal: triggered::Listener) -> Result<(JoinHandle<()>, Channel), Box<dyn std::error::Error>> {
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alain
4
- VERSION = "0.4.1"
4
+ VERSION = "0.5.0"
5
5
  end
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.1
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-09-11 00:00:00.000000000 Z
11
+ date: 2021-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tomlrb