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/07/26 11:03] – Updated stijnm | at:tutorial:distribution [2007/12/18 13:57] – * tvcutsem | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | < | ||
- | This tutorial is under heavy construction! | ||
- | </ | ||
- | |||
====== Distributed Programming ====== | ====== 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, | + | 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, |
These requirements correspond to the cornerstones of the Ambient-Oriented Programming paradigm. The seamless integration of language support for dealing with partial failures and performing service discovery, hinge on AmbientTalk' | These requirements correspond to the cornerstones of the Ambient-Oriented Programming paradigm. The seamless integration of language support for dealing with partial failures and performing service discovery, hinge on AmbientTalk' | ||
Line 29: | 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 50: | Line 46: | ||
< | < | ||
when: InstantMessenger discovered: { |messenger| | when: InstantMessenger discovered: { |messenger| | ||
- | when: (messenger< | + | |
- | buddyList.put(name, | + | buddyList.put(name, |
- | system.println(" | + | system.println(" |
- | | + | }; |
}; | }; | ||
</ | </ | ||
Line 66: | Line 62: | ||
As '' | As '' | ||
- | |||
===== Partial Failure Handling ===== | ===== Partial Failure Handling ===== | ||
Line 83: | 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 95: | Line 90: | ||
This code illustrate how the instant messenger application notifies when a buddy goes online or offline. In the above code, '' | This code illustrate how the instant messenger application notifies when a buddy goes online or offline. In the above code, '' | ||
- | In other to cope with partial failures, AmbientTalk also allows developers to retract all currently unsent messages from the far reference outbox by means of the '' | + | In order to cope with partial failures, AmbientTalk also allows developers to retract all currently unsent messages from the far reference outbox by means of the '' |
The '' | The '' | ||
Line 101: | Line 96: | ||
< | < | ||
when: Service discovered: { | reference | | when: Service discovered: { | reference | | ||
- | | + | |
- | | + | messages := retract: reference; |
- | } | + | } |
} | } | ||
</ | </ | ||
Line 127: | 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