Skip to content

Async Channel support  #25

Closed
Closed
@hyperthunk

Description

@hyperthunk

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions