Re: Query regarding behavior of handle.deliver()
Mercado <[email protected]>
| Newsgroups | gmane.network.open-pegasus.general |
|---|---|
| Message-ID | <[email protected]> |
Ajay, I believe that I have been receiving email correspondence from you and your colleagues in error. My email address is [email protected]. Please send me confirmation that you have removed my email address from your email distribution group. From: Ajay N Rao <[email protected]> To: ujjwal lanjewar <[email protected]> Cc: "[email protected]" <[email protected]>; [email protected] Sent: Tuesday, August 23, 2011 11:08 PM Subject: Re: Query regarding behavior of handle.deliver() Hi ujjwal, If we do as follows: loop { // Collect the instance handler.deliver(instance) // Deliver the instance handler.complete() // Send the delivered instance to client } Then the handler can not be used again after the handler.complete(). handler.deliver() will accumulate the objects one by one, and the handler.complete() will send all the instances to the client. I think after sending the one object the handler cannot be used again. Regards, Ajay From: ujjwal lanjewar <[email protected]> To: Ajay N Rao/India/IBM@IBMIN, "[email protected]" <[email protected]> Date: 08/24/2011 09:13 AM Subject: Re: Query regarding behavior of handle.deliver() Hi Ajay, Swanand is talking about the case where say there are 1000 enumerations to be sent to client. Provider is going to take some time to collect information these 1000 instances, as it collects instances one at a time. The point is to send the first instance immediately to CIM client so that it can process that instance instead of waiting for all the 1000 instances. This is how the WBEM protocol is designed. With the current provider example, this is not the case: loop { // Collect the insance handler.deliver(instance) <--- This should sent the instance to CIM Client immediately. However this is not the case } handler.complete() <---- This results in all the instances to be sent to to CIM Client however its too late, as it is outside of loop. Question is... Can we do something like this... loop { // Collect the instance handler.deliver(instance) // Deliver the instance handler.complete() // Send the delivered instance to client } Regards Ujjwal From: Ajay N Rao <[email protected]> To: [email protected]; [email protected] Sent: Tuesday, August 23, 2011 3:55 AM Subject: Re:Query regarding behavior of handle.deliver() Hi swanand, Pls refer sample providers given in the following path in the pegasus directory: src/Providers/sample/ src/Providers/sample/InstanceProvider some of the providers use the same approach as mentioned by you in the note. for (each instance) { ..... handler.deliver(instance); } handler.complete(); Regards, Ajay From: swanand Dunakhe <[email protected]> To: "[email protected]" <[email protected]> Date: 08/23/2011 01:31 PM Subject: Query regarding behavior of handle.deliver() Hi, I have a query regarding behavior of handle.deliver(). Description says "The deliver function is used by providers to deliver results to the CIM Server" I need to return an enumeration to a CIM client, which will process the enumeration iteratively. The problem is, the Client can not gain a control to process the the enumeration until all the objects in enumeration are accumulated at CIM server. The creation of objects may take a longer time, so we don't want all the objects to be accumulated in an enumeration. Once the object is collected at server side, it should be used by client instead of waiting for all the enumeration, Documentation says that the objects are delivered to server asynchronously, but the client is waiting for all the objects to be filled up in enumeration. I need an iterative approach for the same. is there anything that can be done to resolve the issue? Note:handler.complete() gives the control to client and gets out of the enumerateInstances() method, so I am using handler.complete() at the end. e.g //handler.processing(); //some code; for (some conditions) { //collect the cim instance and deliver; //handler.deliver() //I expect, the instance should be consumed by client at this same point. } handler.complete(); //But client gets control after this statement. Please let me know your inputs for the same. Thanks, Swa. Thank you, Marc Mercado