{"size": 1445, "ext": "scrbl", "max_stars_repo_path": "alexis-multicast/alexis/scribblings/alexis-multicast.scrbl", "max_stars_repo_name": "lexi-lambda/racket-alexis", "max_stars_repo_stars_event_min_datetime": "2015-07-09T19:27:40.000Z", "max_stars_repo_stars_event_max_datetime": "2015-07-09T19:27:40.000Z", "max_issues_repo_path": "alexis-multicast/alexis/scribblings/alexis-multicast.scrbl", "max_issues_repo_name": "lexi-lambda/racket-alexis", "max_issues_repo_issues_event_min_datetime": "2015-07-05T17:31:57.000Z", "max_issues_repo_issues_event_max_datetime": "2017-08-10T22:26:27.000Z", "max_forks_repo_path": "alexis-multicast/alexis/scribblings/alexis-multicast.scrbl", "max_forks_repo_name": "lexi-lambda/racket-alexis", "max_forks_repo_forks_event_min_datetime": "2015-07-09T17:19:32.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-06T06:04:37.000Z"}
{"max_stars_count": 1, "max_issues_count": 11, "max_forks_count": 4, "avg_line_length": 46.6129032258, "max_line_length": 102, "alphanum_fraction": 0.7453287197}
#lang scribble/manual

@(require (for-label racket/base
                     racket/contract
                     racket/async-channel
                     alexis/multicast))

@title{Multicast Asynchronous Channels}

@defmodule[alexis/multicast]

This provides an implementation of @deftech{multicast channels}, an extension of
@tech[#:doc '(lib "scribblings/reference/reference.scrbl")]{asynchronous channels} that may have
multiple recievers. Unlike asynchronous channels, multicast channels have distinct “server” and
“receiver” objects, since multicast channels create a one-to-many relationship.

@defproc[(make-multicast-channel) multicast-channel?]{
Creates and returns a new @tech{multicast channel} server.}

@defproc[(multicast-channel? [v any/c]) boolean?]{
Returns @racket[#t] if @racket[v] is a @tech{multicast channel}, @racket[#f] otherwise.}

@defproc[(make-multicast-receiver [mc multicast-channel?]) async-channel?]{
Creates a receiver asynchronous channel that receives messages from @racket[mc]. The returned value is
a standard @tech[#:doc '(lib "scribblings/reference/reference.scrbl")]{asynchronous channel} from
@racketmodname[racket/async-channel], but it does @italic{not} support @racket[async-channel-put].
Attempting to write to a receiver channel will raise an exception.}

@defproc[(multicast-channel-put [mc multicast-channel?] [v any/c]) void?]{
Broadcasts @racket[v] to all receivers listening to @racket[mc].}
