Skip to content

Async Channel support #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hyperthunk opened this issue Dec 12, 2012 · 2 comments
Closed

Async Channel support #25

hyperthunk opened this issue Dec 12, 2012 · 2 comments

Comments

@hyperthunk
Copy link
Member

Once we've cracked issue #8 (and have passing tests) then we should really extend the Control.Distributed.Platform.Async module to support Channels too. For this extension, I think it actually does make sense to make the async task definition a function whose type is aware of the reply channel

-- NB: AsyncTask is a replacement for SpawnAsync

-- | A task to be performed asynchronously. This can either take the
-- form of an action that runs over some type @a@ in the @Process@ monad,
-- or a tuple that adds the node on which the asynchronous task should be
-- spawned - in the @Process a@ case the task is spawned on the local node
type AsyncTask a = Process a | (NodeId, Process a)

-- | A task to be performed asynchronously using typed channels
type AsyncChanTask a = SendPort a -> Process () | (NodeId, SendPort a -> Process ())

``

It is **possible** that the implementation of `Async` (in issue #8) could change to use channels internally anyway, at which point this might become a moot point.
@rodlogic
Copy link

fyi:See this pull request by Simon Marlow:

haskell-distributed/distributed-process@847abf4

It seems to address the issue of efficiently receiving channel and process messages.

@hyperthunk
Copy link
Member Author

The async-refactoring branch now contains two async modules, one for STM based interactions and another one that uses channels. Resolving as a duplicate of issue #38.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants