CodeRelay:
Filter:
Utopia/Classes (extension) | Relay classes

CodeRelay
ExtensionExtension

relays code to network peers and History

Description

When evaluating code, CodeRelay sends the code as string to all the peers in its AddrBook. This can be used to create a shared code history in collaborative live coding performances.

Class Methods

.new

create a new CodeRelay

Arguments:

addrBook

an AddrBook where Peers are registered

post

a flag whether to post code to the post window. default: false

oscPath

the oscPath to use for relaying. default: '/codeRelay'

encryptor

an (optional) encryptor for codeStrings.

codeDumpFunc

an optional function to relay the code strings. default nil will be replaced by a standard function which relays to all peers in the addrBook.

Returns:

a new CodeRelay

Instance Methods

.onlyWorkingCode

When true, coderelay sends only code that has evaluated correctly.

Returns:

a Boolean

.private

When true, coderelay does not send code. Useful for temporary experiments that would clutter a performance history.

Returns:

a Boolean

.post

When true, coderelay will post to post window.

Returns:

a Boolean

.free

remove coderelay by removing codeDumpFunc from interpreter and freeing its oscFunc.

Returns:

the coderelay

.addHistory

add History such that coderelay writes own code and relayed code into History.

Returns:

the coderelay

.removeHistory

remove History from coderelay.

Returns:

the coderelay

.makeOSCFunc

internal method, makes the OSCFunc that receives shared code.

Returns:

the coderelay

Examples