Serve single and batch CLOB order books over HTTP
This commit is contained in:
@@ -119,6 +119,14 @@ impl Exchange {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Read requested outcome books in one consistent database and resident-book snapshot.
|
||||
pub fn public_books(&mut self, tokens: &[String]) -> Result<Vec<Value>> {
|
||||
let tx = expiry::transaction(&self.db, TransactionBehavior::Deferred)?;
|
||||
let books = book_snapshot::read_many(&tx, &mut self.books, tokens)?;
|
||||
tx.commit()?;
|
||||
Ok(books)
|
||||
}
|
||||
|
||||
pub fn market_stream_page(&mut self, market: &str, after: Option<i64>) -> Result<MarketPage> {
|
||||
let tx = expiry::transaction(&self.db, TransactionBehavior::Deferred)?;
|
||||
let page = market_stream::page(&tx, &mut self.books, market, after)?;
|
||||
|
||||
Reference in New Issue
Block a user