It is difficult to process events in order
-
dimas
In 0.8.3 I saw
# TODO: Extract number of threads to use from AHN_CONFIG @@framework_theatre = Theatre::Theatre.newwhich looks like a Good Thing :)
However if the whole config stuff needs to be designed first (soeey I'm not aware of what is there already), it can take very long time.How about adding theatre_thread_count static (class) variable to Adhearsion::Events which defaults to nil but calling code can change its value. If value is not nil it is passed to Theatre.new.
Later when config is added, you can extend the check like:
1. if theatre_thread_count is not nil - use it
2. if theatre_thread_count is not overriden load a value from config.
3. if config does not specify value, use default.This way you can quickly add ability to specify number of threads while still allow doing the same with config when it is ready.
-
Jay Phillips
- State changed from new to open
If you're using this in a standalone Ruby process and want only to capture events in order, I'd probably recommend subclassing ManagerInterface and overriding event_message_received():
class MyManager < Adhearsion::VoIP::Asterisk::Manager::ManagerInterface def event_message_received(event) p event end end # Connect MyManager to Asterisk... MyManager.connect ........ # normal args here -
dimas
Hmmm... how stupid of me.
Yeah I guess it will work and it probably much more clean approach than trying to tune Theatre for my needs.I believe this one can be closed.
-
Ben Klang
- State changed from open to invalid
- Milestone order changed from 0 to 0
Closing per reporter.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.