cloud-pubsub
Provides methods to consume messages from Google PubSub using Futures and Hyper.
Authentication
Authentication is provided by rust-goauth.
The BaseClient expects to receive the path to the file containing your Google Cloud
service account JSON key.
Token Renewal
The JWT token has a short life time and needs to be renewed periodically for long lived processes.
There is a provided helper which will renew the token every 15 mins:
let pubsub = match create ;
run
Env Config
Envy is an excellent way to load your config.
Log Config
In order to produce log output, executables have to use a logger implementation compatible with the log facade. There are many available implementations to chose from, for example:
env_logger is an excellent way to log in your executables.
[]
= "0.4"
= "0.7"
Subscribing
Connecting to existing subscription
let sub = my_client.subscribe
Subscribing to a topic
When subscribing to a topic, a random subscription name will be generated. To prevent dangling
subscriptions, you need to explicitly call subscription.destroy().