Method | Description | |
---|---|---|
BookDetailLookup ( string projectId, Options options = null, ISimpleLogger logger = null ) : Google.Api.Gax | ||
CreateTopicAndSubscription ( ) : void |
Creates the topic and subscription, if they don't already exist. You should call this once at the beginning of your app.
|
|
EnqueueBook ( long bookId ) : void |
Publish a message asking for a book to be processed.
|
|
ParseDate ( string dateString ) : DateTime? |
Parse a date time. Return null if it can't be parsed. A single number will be interpreted as a year, and the date returned will be YEAR-01-01.
|
|
ProcessBook ( IBookStore bookStore, long bookId ) : void |
Look up a book in Google's Books API. Update the book in the book store.
|
|
PullLoop ( Action |
Pulls books from the queue and invokes your callback for each book.
|
|
StartPullLoop ( IBookStore bookStore, |
||
UpdateBookFromJson ( string json, |
Updates book with information parsed from a json response from Google's Books API.
|
Method | Description | |
---|---|---|
PullOnce ( Action |
Makes one call to PubSub.Pull to pull some books from the subscription.
|
public BookDetailLookup ( string projectId, Options options = null, ISimpleLogger logger = null ) : Google.Api.Gax | ||
projectId | string | |
options | Options | |
logger | ISimpleLogger | |
return | Google.Api.Gax |
public static ParseDate ( string dateString ) : DateTime? | ||
dateString | string | A string representation of the date. |
return | DateTime? |
public ProcessBook ( IBookStore bookStore, long bookId ) : void | ||
bookStore | IBookStore | Where the book is stored. |
bookId | long | The id of the book to look up. |
return | void |
public PullLoop ( Action |
||
callback | Action |
This callback will be invoked for every book. /// Must be thread safe. |
cancellationToken | Stop looking by cancelling this token. /// Must not be null. | |
return | void |
public StartPullLoop ( IBookStore bookStore, |
||
bookStore | IBookStore | |
cancellationToken | ||
return | Task |
public static UpdateBookFromJson ( string json, |
||
json | string | A response from Google's Books API. |
book | Fields in book will be overwritten. | |
return | void |