Objects Asynchronous Operation

Registered by Sahid Orentino

The aim of this blueprint is to enhance the remotable api to provide an easy way to do async operation over RPC

  class MyObject(base.NovaObject):
    fields = {...}
    ...

  @remotable_async
  def save(self):
    ...
  @remotable_classmethod_async
   def get_by_instance_uuid_async(cls, id):
     ...

When using, this object a new object "Future" will be returned

  future = MyObject.get_by_instance_uuid(uuid)
  ... do some stuff ..
  obj = future.get_result()
  obj.foo = 'bar'
  future = obj.save_async()
  ... do some stuff ..
  future.get_result() # This call is not necessary even if you want to block the process until you get the result.

To achieve this two situation are possible.

From oslo point of view, the project need to provide new method "call_async?" which will immediately return the object Future. In Nova the conductor should be enhanced by new method "object_action_async?" which will call the new method from oslo. Then new decorator has to be defined "remotable_async" and "remotable_classmethod_async"

An alternative to oslo can be done with the module threading and, the conductor will be enchanced by a new method "object_action_async?" this method while return an object future.

 ...A very simple example:

  def object_action_async(self, context, ...):
    return Future(run=object_action, self=self, context=context, ....).run()

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
Sahid Orentino
Direction:
Needs approval
Assignee:
Sahid Orentino
Definition:
Obsolete
Series goal:
None
Implementation:
Unknown
Milestone target:
None
Completed by
Sahid Orentino

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.