
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Tribe EM is a Ruby gem that adds event-driven network IO to [Tribe] (https://github.com/chadrem/tribe "Tribe"). It is based on [EventMachine] (http://rubyeventmachine.com/ "EventMachine").
Add this line to your application's Gemfile:
gem 'tribe_em'
And then execute:
$ bundle
Or install it yourself as:
$ gem install tribe_em
You can test the below code using a utility such as telnet (telnet localhost 9000), entering some text, and then killing telnet.
# Create a custom connection actor class.
class EchoConn < Tribe::EM::Connection
private
def exception_handler(e)
super
puts concat_e("EchoConn (#{identifier}) died.", e)
end
def post_init_handler
puts "Actor (#{identifier}) connected to client using thread (#{Thread.current.object_id})."
end
def receive_data_handler(data)
puts "Actor (#{identifier}) received data (#{data}) using thread (#{Thread.current.object_id})."
write(data)
shutdown!
end
def unbind_handler
puts "Actor (#{identifier}) disconnected from client using thread (#{Thread.current.object_id})."
end
end
# Create your server actor.
server = Tribe::EM::TcpServer.new('localhost', 9000, EchoConn)
Tribe EM is designed to be easily customized through inheritence of Tribe::EM::Connection. Communication between EventMachine and the Tribe actor system is provided by Tribe::EM::ActorProxy.
Tribe EM has native TCP server and connection classes built in. Other protocol implementations can be found below. Note that some impmementations are marked as native while others are marked as wrappers. Native implementations are specifically designed to for Tribe EM and thus push most work to the actor threads. Wrapper implementations wrap existing EM libraries and usually do more work in the EM thread. This means that native implmentations (when used with real threads via JRuby) will scale better on multi-core systems. None of this really matters much with MRI Ruby since it has a global interpretter lock.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that tribe_em demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.