({{, (RefLink[RemoveChannelSubscribers, paclet:ref/RemoveChannelSubscribers])[channel] 
removes all subscribers from the specified channel.}, {, (RefLink[RemoveChannelSubscribers, paclet:ref/RemoveChannelSubscribers])[channel,user]
removes the specified user from the subscriber list.}, {, (RefLink[RemoveChannelSubscribers, paclet:ref/RemoveChannelSubscribers])[channel,{(Subscript[user, 1]),(Subscript[user, 2]),…}]
removes the specified subscribers (Subscript[user, i]).}})

OpenersNotesSection(Spacer1)Details and Options

In (RefLink[RemoveChannelSubscribers, paclet:ref/RemoveChannelSubscribers])[channel,…], channel can be specified as a channel object or in any of the forms used inside (RefLink[ChannelObject, paclet:ref/ChannelObject]).

(RefLink[RemoveChannelSubscribers, paclet:ref/RemoveChannelSubscribers]) attempts to stop the corresponding channel listener object (RefLink[ChannelListener, paclet:ref/ChannelListener]) in the subscriber's session.

You must have execute permission on a channel to remove its subscribers.

OpenersPrimaryExamplesSection(Spacer1)Examples  (8)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Subscribe to a channel and check the subscriber list:

channel=CreateChannel["x"]

ChannelListen[channel]

ChannelSubscribers[channel]

Terminate subscription and remove the channel:

RemoveChannelSubscribers[channel,%]

ChannelSubscribers[channel]

DeleteObject[channel]

OpenersExampleSection1(Spacer1)Scope  (2)

Start listening on a channel and remove the subscription for the specified user:

ChannelListen["x"]

RemoveChannelSubscribers["x",$WolframID]

Remove all subscribers of a channel:

ChannelListen["x"]

RemoveChannelSubscribers["x"]

OpenersExampleSection3(Spacer1)Applications  (2)

OpenersExampleSubsection0(Spacer1)Administration by Channel Creator  (1)

Create a public channel and start listening:

channel=CreateChannel["public",Permissions->"Public"]

ChannelListen[channel]

Let another user listen on your channel by executing the following command in their Wolfram Language session:

ChannelListen["user@sample.com:public"]

Current subscribers on the channel:

ChannelSubscribers[channel]

Unsubscribe the other user:

RemoveChannelSubscribers[channel,Complement[%,{$WolframID}]]

Only the current user remains on the channel:

ChannelSubscribers[channel]

Clean up:

RemoveChannelListener[]

DeleteChannel[channel]

OpenersExampleSubsection1(Spacer1)Administration by Third Parties  (1)

Create a public channel and grant the "Execute" privileges to another user:

channel=CreateChannel["public",Permissions->\[LeftAssociation]"All"->{"Read","Write"},{"Owner","another@sample.com"}->"Execute"\[RightAssociation]]

Start listening on the channel:

ChannelListen[channel]

Let the other user terminate your subscription by executing the following command in their session:

RemoveChannelSubscribers["user@sample.com:public","user@sample.com"]

The channel no longer has subscribers:

ChannelSubscribers[channel]

Clean up:

DeleteChannel[channel]

OpenersExampleSection4(Spacer1)Properties & Relations  (3)

(RefLink[RemoveChannelListener, paclet:ref/RemoveChannelListener]) terminates subscription in the current session without resorting to (RefLink[RemoveChannelSubscribers, paclet:ref/RemoveChannelSubscribers]):

channel=CreateChannel["x"]

ChannelListen[channel]

RemoveChannelListener[%]

ChannelSubscribers["x"]

(RefLink[RemoveChannelSubscribers, paclet:ref/RemoveChannelSubscribers]) terminates the current subscription, but does not prevent the user from resubscribing:

ChannelListen["x"]

RemoveChannelSubscribers["x"]

ChannelListen["x"]

Clean up:

RemoveChannelListener[]

Revoking listening privileges by setting channel permissions prevents future access to the channel, but does not affect the currently active listeners:

channel=CreateChannel["private",Permissions->"Private"]

ChannelListen["private"]

SetOptions[channel,Permissions-><|"Owner"->{"Write","Execute"}|>]

Use (RefLink[RemoveChannelSubscribers, paclet:ref/RemoveChannelSubscribers]) in addition to (RefLink[SetOptions, paclet:ref/SetOptions]) to terminate the current listeners and prevent future access:

RemoveChannelSubscribers[channel]

Clean up the channel:

DeleteObject[channel]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[ChannelSubscribers, paclet:ref/ChannelSubscribers])  ▪  (RefLink[ChannelListener, paclet:ref/ChannelListener])  ▪  (RefLink[RemoveChannelListener, paclet:ref/RemoveChannelListener])  ▪  (RefLink[ChannelObject, paclet:ref/ChannelObject])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Channel-Based Communication, paclet:guide/Channel-BasedCommunication])}})}})