Partial conversion to a typed wrappper

This commit is contained in:
Graham Christensen 2018-01-31 09:06:40 -05:00
parent 634f2bb51f
commit 8ff9fa9638
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C
4 changed files with 11 additions and 3 deletions

View file

@ -16,6 +16,8 @@ use amqp::Table;
use ofborg::config; use ofborg::config;
use ofborg::worker; use ofborg::worker;
use ofborg::tasks; use ofborg::tasks;
use ofborg::easyamqp;
use ofborg::easyamqp::TypedWrappers;
fn main() { fn main() {
@ -25,7 +27,7 @@ fn main() {
println!("Hello, world!"); println!("Hello, world!");
let mut session = Session::open_url(&cfg.rabbitmq.as_uri()).unwrap(); let mut session = easyamqp::session_from_config(&cfg.rabbitmq).unwrap();
println!("Connected to rabbitmq"); println!("Connected to rabbitmq");
let mut channel = session.open_channel(1).unwrap(); let mut channel = session.open_channel(1).unwrap();

View file

@ -12,13 +12,15 @@ use ofborg::config;
use ofborg::worker; use ofborg::worker;
use ofborg::tasks; use ofborg::tasks;
use amqp::Basic; use amqp::Basic;
use ofborg::easyamqp;
use ofborg::easyamqp::TypedWrappers;
fn main() { fn main() {
let cfg = config::load(env::args().nth(1).unwrap().as_ref()); let cfg = config::load(env::args().nth(1).unwrap().as_ref());
ofborg::setup_log(); ofborg::setup_log();
let mut session = easyamqp::session_from_config(&cfg.rabbitmq).unwrap();
let mut session = Session::open_url(&cfg.rabbitmq.as_uri()).unwrap();
println!("Connected to rabbitmq"); println!("Connected to rabbitmq");
let mut channel = session.open_channel(1).unwrap(); let mut channel = session.open_channel(1).unwrap();

View file

@ -13,6 +13,8 @@ use ofborg::config;
use ofborg::notifyworker; use ofborg::notifyworker;
use ofborg::tasks::build; use ofborg::tasks::build;
use ofborg::message::buildjob; use ofborg::message::buildjob;
use ofborg::easyamqp;
use ofborg::easyamqp::TypedWrappers;
fn main() { fn main() {
let cfg = config::load(env::args().nth(1).unwrap().as_ref()); let cfg = config::load(env::args().nth(1).unwrap().as_ref());

View file

@ -13,6 +13,8 @@ use ofborg::worker;
use amqp::Session; use amqp::Session;
use amqp::Table; use amqp::Table;
use amqp::Basic; use amqp::Basic;
use ofborg::easyamqp;
use ofborg::easyamqp::TypedWrappers;
fn main() { fn main() {
let cfg = config::load(env::args().nth(1).unwrap().as_ref()); let cfg = config::load(env::args().nth(1).unwrap().as_ref());