at:tutorial:distribution
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
at:tutorial:distribution [2007/06/19 16:09] – tvcutsem | at:tutorial:distribution [2007/10/08 13:38] – corrected tvcutsem | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | < | + | ====== Distributed Programming ====== |
- | This tutorial is under heavy construction! | + | |
- | </ | + | |
- | ====== Distributed Programming ====== | + | Building on the actor-based concurrency model explained in the [[actors|previous chapter]], this chapter discusses the distribution provisions of AmbientTalk. For actors to communicate across the boundaries of a single device, actors need to be capable of discovering one another' |
- | This tutorial chapter discusses how AmbientTalk virtual machines can discover and communicate with each other over the network. | + | These requirements correspond to the cornerstones of the Ambient-Oriented Programming paradigm. The seamless |
- | The integration of distribution was one of the main concerns in the design of AmbientTalk | + | |
- | More specifically, as a distributed programming language that adheres | + | Before delving in these topics, we illustrate how to activate |
===== Starting the Network.. ===== | ===== Starting the Network.. ===== | ||
Line 14: | Line 11: | ||
AmbientTalk provides an unique native object, named '' | AmbientTalk provides an unique native object, named '' | ||
- | When the virtual machine goes online, | + | When the virtual machine goes online, the built-in |
+ | |||
+ | Taking a virtual machine | ||
< | < | ||
Line 26: | Line 25: | ||
deftype Printer; | deftype Printer; | ||
def service := object: { | def service := object: { | ||
- | def print(aDoc) { | + | |
- | system.println(" | + | system.println(" |
- | } | + | } |
}; | }; | ||
export: service as: Printer; | export: service as: Printer; | ||
Line 47: | Line 46: | ||
< | < | ||
when: InstantMessenger discovered: { |messenger| | when: InstantMessenger discovered: { |messenger| | ||
- | when: (messenger< | + | |
- | buddyList.put(name, | + | buddyList.put(name, |
- | system.println(" | + | system.println(" |
- | | + | }; |
}; | }; | ||
</ | </ | ||
Line 63: | Line 62: | ||
As '' | As '' | ||
- | |||
===== Partial Failure Handling ===== | ===== Partial Failure Handling ===== | ||
Line 80: | Line 78: | ||
< | < | ||
when: InstantMessenger discovered: { |messenger| | when: InstantMessenger discovered: { |messenger| | ||
- | ... | + | |
- | when: messenger disconnected: | + | when: messenger disconnected: |
- | system.println(" | + | system.println(" |
- | }; | + | }; |
- | when: messenger reconnected: | + | when: messenger reconnected: |
- | system.println(" | + | system.println(" |
- | }; | + | }; |
}; | }; | ||
</ | </ | ||
Line 98: | Line 96: | ||
< | < | ||
when: Service discovered: { | reference | | when: Service discovered: { | reference | | ||
- | | + | |
- | | + | messages := retract: reference; |
- | } | + | } |
} | } | ||
</ | </ | ||
Line 124: | Line 122: | ||
< | < | ||
when: messenger takenOffline: | when: messenger takenOffline: | ||
- | system.println(" | + | |
- | | + | //clean certain resources associated to the buddy |
}; | }; | ||
</ | </ |
at/tutorial/distribution.txt · Last modified: 2009/01/30 16:13 by tvcutsem