Wrox Programmer Forums
|
BOOK: Professional Microsoft Robotics Studio ISBN: 978-0-470-14107-6
This is the forum to discuss the Wrox book Professional Microsoft Robotics Developer Studio by Kyle Johns, Trevor Taylor; ISBN: 9780470141076
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Microsoft Robotics Studio ISBN: 978-0-470-14107-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 25th, 2008, 09:57 PM
Registered User
 
Join Date: Jun 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Receiver Usage

Hello,

I understand that an Arbiter.Interleave type of receivier is automatically created for you to support port operations.

What would be the typical use for additional receivers, such as a Arbiter.Choice and/or Arbiter.JoinedReceive? Would these be usd for internal (i.e within its own service) asynchronous signalling?

Thanks,
Scott



 
Old June 25th, 2008, 11:02 PM
Wrox Author
 
Join Date: Apr 2008
Posts: 60
Thanks: 0
Thanked 5 Times in 5 Posts
Default

When you create a new service, it is automatically subclassed off DsspServiceBase. This does some of the work for you in setting up and managing your CCR and DSS environment.

As you noted, an Interleave is created called MainPortInterleave. It is important to use CombineWith to add your service handlers to this interleave because it provides exclusive access to resources such as your service state. If you create your own Interleaves then they will not all be coordinated.

You use Choice and JoinedReceive to handle internal messages, as you suggest. There are often situations where you don't want to go through the main interleave because it is not relevant. It really depends on your logic.

In terms of message processing, a Choice is equivalent to an OR and a Join is equivalent to an AND. So if your code cannot proceed until two messages arrive (AND) then a Join is appropriate.

The most common use of Choice is to handle possible exceptions, including timeouts. In this case you want to receive either the response OR an exception but you can never receive both.

Another point about an Interleave is that you can't (easily) see what messages are waiting for the various ports. The interleave manages incoming messages so the ports will always appear to be empty. However, if you simply forward messages to another port then you can do your own throttling.

Trevor







Similar Threads
Thread Thread Starter Forum Replies Last Post
about the usage of ant wangpan J2EE 5 June 12th, 2007 06:57 AM
New keyword Usage John Pennington Beginning VB 6 4 August 8th, 2006 10:39 PM
CONTAINS keyword usage caterpillar SQL Server 2000 2 July 12th, 2006 01:19 PM
mail not received by the receiver but successfully gauravchhabra9111 J2EE 0 March 22nd, 2005 04:46 AM
Software usage [email protected] C++ Programming 0 October 15th, 2004 06:30 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.