move clients to module

This commit is contained in:
Brandon Thomas committed 2021-05-08 03:49:10 -04:00
1 parent 876b149331
commit 69f2e2164e
6 files changed
+11 -10

No files matched your search

+1 -1
View File
@@ -5,11 +5,11 @@ use std::env;
fn main() -> anyhow::Result<()> {
// NB: Control prost output dir with env var
// Typically these land in `target/`, but I want to source control these.
env::set_var("OUT_DIR", "src/proto_codegen");
prost_build::compile_protos(
&[
// TODO: This needs to respect glob
"protos/storyteller-protos/protos/pubsub-events/pubsub-events.proto",
"protos/storyteller-protos/protos/unreal/unreal.proto",
],
+2
View File
@@ -0,0 +1,2 @@
pub mod redis_client;
pub mod redis_subscriber;
File renamed without changes.
File renamed without changes.
@@ -1,15 +1,15 @@
use crate::AnyhowResult;
use crate::clients::redis_client::RedisClient;
use crate::dispatcher::TextCommandHandler;
use crate::inbound_proto_utils::{InboundEvent, InboundEventSource};
use crate::protos::protos;
use crate::redis_client::RedisClient;
use crate::text_chat_parsers::first_pass_command_parser::FirstPassParsedCommand;
use futures::executor::block_on;
use lazy_static::lazy_static;
use log::{info, warn};
use prost::Message;
use regex::Regex;
use std::sync::{RwLock, Arc, Mutex};
use crate::text_chat_parsers::first_pass_command_parser::FirstPassParsedCommand;
use crate::inbound_proto_utils::{InboundEvent, InboundEventSource};
use crate::AnyhowResult;
// TODO: maybe separate text command handling and data source concerns
// like this? Though maybe it's too early to optimize this.
+4 -5
View File
@@ -3,13 +3,12 @@ extern crate lazy_static;
#[macro_use]
extern crate serde_derive;
mod clients;
mod dispatcher;
mod handlers;
mod inbound_proto_utils;
mod outbound_proto_utils;
mod protos;
mod redis_client;
mod redis_subscriber;
mod secrets;
mod text_chat_parsers;
@@ -21,11 +20,11 @@ use redis::{AsyncCommands, RedisResult};
use std::thread;
use std::time::Duration;
use crate::secrets::Secrets;
use crate::redis_client::RedisClient;
use crate::redis_subscriber::RedisSubscribeClient;
use crate::clients::redis_client::RedisClient;
use crate::clients::redis_subscriber::RedisSubscribeClient;
use crate::dispatcher::Dispatcher;
use crate::handlers::coordinate_and_geocode_handler::CoordinateAndGeocodeHandler;
use crate::secrets::Secrets;
use std::sync::{Arc, Mutex};
pub type AnyhowResult<T> = anyhow::Result<T>;