Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
50 lines (34 sloc) 1.53 KB

VCAP Stager Client

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


Intended to be used when dealing with EM directly.

Sample usage:

client =, 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}" }


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

Sample usage: do
  client =, queue)

    # 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"

File a Bug

Use the Github Issues feature in the appropriate repository to file a bug against Cloud Foundry Open Source and its components,