Method: Async::List#remove

Defined in:
lib/async/list.rb

#remove(node) ⇒ Object

Remove the node. If it was already removed, this will raise an error.

You should be careful to only remove nodes that are part of this list.

[View source]

117
118
119
120
121
122
123
124
# File 'lib/async/list.rb', line 117

def remove(node)
	# One downside of this interface is we don't actually check if the node is part of the list defined by `self`. This means that there is a potential for a node to be removed from a different list using this method, which in can throw off book-keeping when lists track size, etc.
	unless node.head
		raise ArgumentError, "Node is not in a list!"
	end
	
	remove!(node)
end