DataFlowVariable timeout?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

DataFlowVariable timeout?

Hamlet D'Arcy
I'm using a DataFlowVariable to help with asynchronous testing...
waiting for an event to happen and then make assertions against it.


In the following code, the DFV will block until a value is set:

  def event = new DataFlowVariable()

  ...
  assert event.val.source != null

Is there a way to set a timeout value on the wait?

--
Hamlet D'Arcy
[hidden email]

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: DataFlowVariable timeout?

Vaclav
Administrator
Hi Hamlet,

try event.getVal(timeout, units).

Vaclav



On Wed, Feb 10, 2010 at 3:24 PM, Hamlet D'Arcy <[hidden email]> wrote:
I'm using a DataFlowVariable to help with asynchronous testing...
waiting for an event to happen and then make assertions against it.


In the following code, the DFV will block until a value is set:

 def event = new DataFlowVariable()

 ...
 assert event.val.source != null

Is there a way to set a timeout value on the wait?

--
Hamlet D'Arcy
[hidden email]

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
E-mail: [hidden email]
Blog: http://www.jroller.com/vaclav
Linkedin page: http://www.linkedin.com/in/vaclavpech
Reply | Threaded
Open this post in threaded view
|

Re: DataFlowVariable timeout?

Dierk König
Isn't this getting close to java.util.concurrent.Future?

cheers
Dierk

Am 10.02.2010 um 21:05 schrieb Vaclav Pech:

Hi Hamlet,

try event.getVal(timeout, units).

Vaclav



On Wed, Feb 10, 2010 at 3:24 PM, Hamlet D'Arcy <[hidden email]> wrote:
I'm using a DataFlowVariable to help with asynchronous testing...
waiting for an event to happen and then make assertions against it.


In the following code, the DFV will block until a value is set:

 def event = new DataFlowVariable()

 ...
 assert event.val.source != null

Is there a way to set a timeout value on the wait?

--
Hamlet D'Arcy
[hidden email]

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
E-mail: [hidden email]
Blog: http://www.jroller.com/vaclav
Linkedin page: http://www.linkedin.com/in/vaclavpech

Reply | Threaded
Open this post in threaded view
|

Re: DataFlowVariable timeout?

Vaclav
Administrator
Exactly. A glorified Future with a couple more abilities - whenBound handlers, async (non-blocking) read, remoting.
In fact, http://jira.codehaus.org/browse/GPARS-48 suggests to implement the core of DFV with a FutureTask.

Cheers,

Vaclav



On Wed, Feb 10, 2010 at 10:27 PM, Dierk König <[hidden email]> wrote:
Isn't this getting close to java.util.concurrent.Future?

cheers
Dierk

Am 10.02.2010 um 21:05 schrieb Vaclav Pech:

Hi Hamlet,

try event.getVal(timeout, units).

Vaclav



On Wed, Feb 10, 2010 at 3:24 PM, Hamlet D'Arcy <[hidden email]> wrote:
I'm using a DataFlowVariable to help with asynchronous testing...
waiting for an event to happen and then make assertions against it.


In the following code, the DFV will block until a value is set:

 def event = new DataFlowVariable()

 ...
 assert event.val.source != null

Is there a way to set a timeout value on the wait?

--
Hamlet D'Arcy
[hidden email]

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
E-mail: [hidden email]
Blog: http://www.jroller.com/vaclav
Linkedin page: http://www.linkedin.com/in/vaclavpech




--
E-mail: [hidden email]
Blog: http://www.jroller.com/vaclav
Linkedin page: http://www.linkedin.com/in/vaclavpech