Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Cloud Foundry - the open platform as a service project
Ruby
branch: schemata

This branch is 1 commit ahead, 2 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib/vcap/stager
spec
.gitignore
Gemfile
LICENSE
README.md
Rakefile
stager-client.gemspec

README.md

VCAP Stager Client

Provides client implementations for queuing staging tasks. Currently, the following clients are provided:

EmAware

Intended to be used when dealing with EM directly.

Sample usage:

client = VCAP::Stager::Client::EmAware.new(nats_connection, queue)

# Send the request, wait up to 10 seconds for a result
deferrable = client.stage(request, 10)

# Block will be invoked on any reply that is received (regardless of
# whether or not the Stager succeeded or failed).
deferrable.callback { |r| puts "Received response: #{r}" }

# Block will be invoked when an error occurs while processing the request.
# This includes errors deserializing the response and timeouts waiting for
# a reply.
deferrable.errback { |e| puts "An error occurred: #{e}" }

FiberAware

Intended to be used with EM + Fibers. Emulates a blocking api by yielding the calling fiber until the request completes.

Sample usage:

Fiber.new do
  client = VCAP::Stager::Client::FiberAware.new(nats_connection, queue)

  begin
    # Send the request, wait for up to 10 seconds to reply. The current
    # fiber is resumed once the request has completed.
    result = client.stage(request, 10)
  rescue => e
    # Exceptions that occur while performing the request are raised in
    # the calling fiber.
    puts "An error, #{e}, occurred"
  end
end

File a Bug

To file a bug against Cloud Foundry Open Source and its components, sign up and use our bug tracking system: http://cloudfoundry.atlassian.net

Something went wrong with that request. Please try again.