Search Results

Search found 4382 results on 176 pages for 'priority queue'.

Page 17/176 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • In node.js slow readable stream attached to a faster pushing message queue eats up memory

    - by Vishal
    In my node.js program I have a response stream attached to a message queue (zeromq) delivering data at a very high rate. Due to slow network connection the response stream and its underlying implementation is unable to consume data at that pace thus occupying a lot of memory. Do you have any suggestion to solve this problem. For reference please see the code snippet below: zmq.on("message", function(data) { res.write(data); // End response on some event });

    Read the article

  • How do I browse a Websphere MQ message without removing it?

    - by jmgant
    I'm writing a .NET Windows Forms application that will post a message to a Websphere MQ queue and then poll a different queue for a response. If a response is returned, the application will partially process the response in real time. But the response needs to stay in the queue so that a daily batch job, which also reads from the response queue, can do the rest of the processing. I've gotten as far as reading the message. What I haven't been able to figure out is how to read it without removing it. Here's what I've got so far. I'm an MQ newbie, so any suggestions will be appreciated. And feel free to respond in C#. Public Function GetMessage(ByVal msgID As String) As MQMessage Dim q = ConnectToResponseQueue() Dim msg As New MQMessage() Dim getOpts As New MQGetMessageOptions() Dim runThru = Now.AddMilliseconds(CInt(ConfigurationManager.AppSettings("responseTimeoutMS"))) System.Threading.Thread.Sleep(1000) 'Wait for one second before checking for the first response' While True Try q.Get(msg, getOpts) Return msg Catch ex As MQException When ex.Reason = MQC.MQRC_NO_MSG_AVAILABLE If Now > runThru Then Throw ex System.Threading.Thread.Sleep(3000) Finally q.Close() End Try End While Return Nothing 'Should never reach here' End Function NOTE: I haven't verified that my code actually removes the message. But that's how I understand MQ to work, and that appears to be what's happening. Please correct me if that's not the default behavior.

    Read the article

  • Postfix: change sender in queued messages

    - by ring0
    Following a complete re-installation we got a problem with the configuration: the sender address was wrong and some recipients (mail servers) rejected them. So there is a bunch of mails stuck in the Postfix queue. Ideally, a change of the sender address directly in the queued mails, and then flushing the queue would be optimal. I tried this answer that addresses this very problem. But messages don't seem to be easily modifiable in the version I have (2.11.0). For instance there is no /var/spool/mqueue dir, but, instead, /var/spool/postfix/... active bounce corrupt defer deferred dev etc flush hold incoming lib maildrop pid private public saved trace usr and the dir of interest is deferred. I tried to modify a few files there changing the wrong domain with the correct one (and was careful to ensure only those were changed). But then, those mails were moved to corrupt, meaning that a simple text change doesn't seem to work (done with vi). Any other cleaner way to change the sender in queued mails?

    Read the article

  • Logging in worker threads spawned from a pylons application does not seem to work

    - by TimM
    I have a pylons application where, under certain cirumstances I want to spawn multiple worker threads to process items in a queue. Right now we aren't making use of a ThreadPool (would be ideal, but we'll add that in later). The main problem is that the worker threads logging does not get written to the log files. When I run the code outside of the pylons application the logging works fine. So I think its something to do with the pylons log handler but not sure what. Here is a basic example of the code (trimmed down): import logging log = logging.getLogger(__name__) import sys from Queue import Queue from threading import Thread, activeCount def run(input, worker, args = None, simulteneousWorkerLimit = None): queue = Queue() threads = [] if args is not None: if len(args) > 0: args = list(args) args = [worker, queue] + args args = tuple(args) else: args = (worker, queue) # start threads for i in range(4): t = Thread(target = __thread, args = args) t.daemon = True t.start() threads.append(t) # add ThreadTermSignal inputData = list(input) inputData.extend([ThreadTermSignal] * 4) # put in the queue for data in inputData: queue.put(data) # block until all contents are downloaded queue.join() log.critical("** A log line that appears fine **") del queue for thread in threads: del thread del threads class ThreadTermSignal(object): pass def __thread(worker, queue, *args): try: while True: data = queue.get() if data is ThreadTermSignal: sys.exit() try: log.critical("** I don't appear when run under pylons **") finally: queue.task_done() except SystemExit: queue.task_done() pass Take note, that the log lin within the RUN method will show up in the log files, but the log line within the worker method (which is run in a spawned thread), does not appear. Any help would be appreciated. Thanks ** EDIT: I should mention that I tried passing in the "log" variable to the worker thread as well as redefining a new "log" variable within the thread and neither worked. ** EDIT: Adding the configuration used for the pylons application (which comes out of the INI file). So the snippet below is from the INI file. [loggers] keys = root [handlers] keys = wsgierrors [formatters] keys = generic [logger_root] level = WARNING handlers = wsgierrors [handler_console] class = StreamHandler args = (sys.stderr,) level = WARNING formatter = generic [handler_wsgierrors] class = pylons.log.WSGIErrorsHandler args = () level = WARNING format = generic

    Read the article

  • Best way to learn iphone audio queue services, step by step tutorial

    - by optician
    Hi Everyone, I'm trying to learn how to handle audio at a fairly low level with audio queue services. I have been progrmaing in memory managed languages for quite a while, and have just completed the c programing tutorial by vtc (2007). This has left me comfortable with the understanding of pointers and memory allocation, but the apple documention still leaves me wanting for a simpler implenation and explaination. Maybe I need to learn objective c and cocoa better. I have heard that this book is good. Cocoa(R) Programming for Mac(R) OS X (3rd Edition) Could someone suggest a learning path that is going to help me get an better understanding of working with audio and an iphone. I want to be able to play mp3 files back and also alter the pitch of them as they are playing. I am prepared that I may have to temporarily convert the mp3 files into pcm files to do things like that to them. Thanks everyone.

    Read the article

  • Removing NSOperation from queue when view changes.

    - by Nithin
    I am creating an application which involves so many web-service calls. I am using NSOperation to execute the web-service calls. There are several views in the application and I'm calling the web-service each time the view loads. Since it is navigation, if user decides to go back to the previous view even before the operation gets completed, another operation is getting into the queue and will be waiting for the previous operation to be completed. Is there any way to stop the previous operation from being executed when its view changes? pls help

    Read the article

  • TDD and encapsulation priority conflict

    - by Hanseh
    Hi, I just started practicing TDD in my projects. I'm developing a project now using php/zend/mysql and phpunit/dbunit for testing. I'm just a bit distracted on the idea of encapsulation and the test driven approach. My idea behind encapsulation is to hide access to several object functionalities. To make it more clear, private and protected functions are not directly testable(unless you will create a public function to call it). So I end up converting some private and protected functions to public functions just to be able to test them. I'm really violating the principles of encapsulation to give way to micro function testability. Is this the correct way of doing it?

    Read the article

  • Windows xp printer queue issues

    - by BubbaWI
    I have a C# application (.NET 3.5 SP1) that I am printing serial numbers for product for a manufacturing company. I am using Active Reports 3 (ver. 5.2.385.2) to print these labels. However, when the printer(Zebra TLP 3842) has an issue, it seems like the printer queue reprints the print job. This causes duplicate serial numbers to be printed. Does anyone know how to ensure that this will not happen. I would rather not have a serial number print than have duplicate serial numbers.

    Read the article

  • Cannot stop Oracle Queue - Could not find program unit being called: "SYS.DBMS_ASSERT"

    - by Vladimir Bezugliy
    Cannot stop and drop oracle Queue. Following code BEGIN DBMS_AQADM.STOP_QUEUE ( queue_name => 'TEST_QUEUE'); DBMS_AQADM.DROP_QUEUE( queue_name => 'TEST_QUEUE'); END; / produces following errors: ERROR at line 1: ORA-04068: existing state of packages has been discarded ORA-04065: not executed, altered or dropped stored procedure "SYS.DBMS_ASSERT" ORA-06508: PL/SQL: could not find program unit being called: "SYS.DBMS_ASSERT" ORA-06512: at "SYS.DBMS_AQADM_SYS", line 3365 ORA-06512: at "SYS.DBMS_AQADM", line 167 ORA-06512: at line 5 What can be the root cause of this problem?

    Read the article

  • SQL Server Process Queue Race Condition

    - by William Edmondson
    I have an order queue that is accessed by multiple order processors through a stored procedure. Each processor passes in a unique ID which is used to lock the next 20 orders for its own use. The stored procedure then returns these records to the order processor to be acted upon. There are cases where multiple processors are able to retrieve the same 'OrderTable' record at which point they try to simultaneously operate on it. This ultimately results in errors being thrown later in the process. My next course of action is to allow each processor grab all available orders and just round robin the processors but I was hoping to simply make this section of code thread safe and allow the processors to grab records whenever they like. So Explicitly - Any idea why I am experiencing this race condition and how I can solve the problem. BEGIN TRAN UPDATE OrderTable WITH ( ROWLOCK ) SET ProcessorID = @PROCID WHERE OrderID IN ( SELECT TOP ( 20 ) OrderID FROM OrderTable WITH ( ROWLOCK ) WHERE ProcessorID = 0) COMMIT TRAN SELECT OrderID, ProcessorID, etc... FROM OrderTable WHERE ProcessorID = @PROCID

    Read the article

  • base for setQueueXmlPath

    - by antony.trupe
    I can't figure out how to point unit tests at the queue config file. Unit Test snippet // TaskQueue setup LocalTaskQueueTestConfig tqConfig = new LocalTaskQueueTestConfig(); tqConfig.setQueueXmlPath("/war/WEB_INF/queue.xml"); Stack Trace java.lang.IllegalStateException: The specified queue is unknown : zip-fetch at com.google.appengine.api.labs.taskqueue.QueueApiHelper.translateError(QueueApiHelper.java:56) at com.google.appengine.api.labs.taskqueue.QueueApiHelper.translateError(QueueApiHelper.java:111) at com.google.appengine.api.labs.taskqueue.QueueApiHelper.makeSyncCall(QueueApiHelper.java:32) at com.google.appengine.api.labs.taskqueue.QueueImpl.add(QueueImpl.java:310) at com.google.appengine.api.labs.taskqueue.QueueImpl.add(QueueImpl.java:282) at com.google.appengine.api.labs.taskqueue.QueueImpl.add(QueueImpl.java:267) at ...

    Read the article

  • How to give highest priority to events generated from main thread than those generated from secondar

    - by martjno
    I have a c++ application written in wxWidgets, which has a main thread (GUI) and a working thread (calculations). The working thread executes commands requested by the main thread and communicates the result to the main thread posting an event after every step of the processing. The problem is that when the working thread is sending many events consecutively, the gui requests made by the user (i.e. interrupt the processing clicking a button) won't be processed by the event handler until the working thread has finished. This is actually happening on OSX, on Windows it works perfectly. I've tried to wxThread::SetPriority and wxThread::Yield but nothing changes. It is working if I put wxThread::Sleep in the working thread, but this slows down very much the processing.

    Read the article

  • Dependency Property Set Priority: CodeBehind vs. XAML

    - by LukePet
    When I initialize a control property from code, the binding to the same property defined on XAML don't work. Why? For Example, I set control properties on startup with this statements: myControl.SetValue(UIElement.VisibilityProperty, DefaultProp.Visibility); myControl.SetValue(UIElement.IsEnabledProperty, DefaultProp.IsEnabled); and on xaml I bind the property of myControl in this way: IsEnabled="{Binding Path=IsKeyControlEnabled}" now, when the property "IsKeyControlEnabled" changes to false, myControl remains enabled (because it's initialize with true value). How can I do?

    Read the article

  • Audio queue start failed

    - by mobapps99
    Hi , i'm developing a project which has both audio streaming and playing audio from file. For audio streaming i'm using AudioStreamer and for playing from file i'm using avaudioplayer. Both streaming and playing works perfectly as long as the app is not interrupted by a phone call or sms. But when a call/sms comes after dismissing the call when i try to restart streaming i'm getting the error "Audio queue start failed" . This happens only when i have used avaudioplayer at least once and after that used streaming. When the avaudioplayer obeject is not created , in this scenario the there is no problem with resuming streaming after dismissing the call. My guess is that some thing is wrong with audioqueue. Help is very much appreciated.......

    Read the article

  • jQuery event handler queue

    - by resopollution
    Overview of the problem In jQuery, the order in which you bind a handler is the order in which they will be executed if you are binding to the same element. For example: $('#div1').bind('click',function(){ // code runs first }); $('#div1').bind('click',function(){ // code runs second }); But what if I want the 2nd bound code to run first? . My current solution Currently, my solution is to modify the event queue: $.data(domElement, 'events')['click'].unshift({ type : 'click', guid : null, namespace : "", data : undefined, handler: function() { // code } }); . Question Is there anything potentially wrong with my solution? Can I safely use null as a value for the guid? Thanks in advance. .

    Read the article

  • How to schedule emails to send out

    - by luckytaxi
    Using PHP, I have a query that goes through my DB looking for pending tasks with reminder triggers at certain times of the day. I have a cronjob that runs every 10 mins and checks the DB for any rows that has "remind_me" field set to go off within the next 10 mins. If it does find something, what's the best way to queue an email with the task information? I guess I'll need some sort of message queue system, but how does the email part work? Will I need another cronjob that runs every minute to check the queue system?

    Read the article

  • Rabbitmq queue sharding

    - by kolchanov
    I have to implement this scenario: An external application publish message to rabbitmq. This message has a client_id property. We can place this id to routing key or message header or some other property. I have to implement sharding in a exchange routng logic - the message should be delivered to specific queue based on the client_id range. Is it possible to implement in a standard exchanges? If not what exchange should I take as the base? How to dynamicly change client_id ranges?

    Read the article

  • Flatten date range memberships retaining only the highest priority membership (TRANSACT-SQL)

    - by shadowranger
    Problem statement: A table contains an item_id, a category_id and a date range (begin_date and end_date). No item may be in more than one category on any given date (in general; during daily rebuilding it can be in an invalid state temporarily). By default, all items are added (and re-added if removed) to a category (derived from outside data) automatically on a daily basis, and their membership in that category matches the lifespan of the item (items have their own begin and end date, and usually spend their entire lives in the same category, which is why this matches). For items in category X, it is occasionally desirable to override the default category by adding them to category Y. Membership in category Y could entirely replace membership in category X (that is, the begin and end dates for membership in category Y would match the begin and end dates of the item itself), or it could override it for an arbitrary period of time (at the beginning, middle or end the item's lifespan, possibly overriding for short periods at multiple times). Membership in category Y is not renewed automatically and additions to that category is done by manual data entry. Every day, when category X is rebuilt, we get an overlap, where any item in category Y will now be in category X as well (which is forbidden, as noted previously). Goal: After each repopulation of category X (which is done in a rather complicated and fragile manner, and ideally would be left alone), I'm trying to find an efficient means of writing a stored procedure that: Identifies the overlaps Changes existing entries, adds new ones where necessary (such as in the case where an item starts in category X, switches to category Y, then eventually switches back to category X before ending), or removes entries (when an item is in category Y for its entire life) such that every item remains in category Y (and only Y) where specified, while category X membership is maintained when not overridden by category Y. Does not affect memberships of categories A, B, C, Z, etc., which do not have override categories and are built separately, by completely different rules. Note: It can be assumed that X membership covers the entire lifespan of the item before this procedure is called, so it is unnecessary to query any data outside this table. Bonus credit: If for some reason there are two adjacent or overlapping memberships in for the same item in category Y, stitching them together into a single entry is appreciated, but not necessary. Example: item_id category_id begin_date end_date 1 X 20080101 20090628 1 Y 20090101 20090131 1 Y 20090601 20090628 2 X 20080201 20080731 2 Y 20080201 20080731 Should become: item_id category_id begin_date end_date 1 X 20080101 20081231 1 Y 20090101 20090131 1 X 20090201 20090531 1 Y 20090601 20090628 2 Y 20080201 20080731 If it matters, this needs to work on SQL Server 2005 and SQL Server 2008

    Read the article

  • Two BlockingQueue in the same endless loop?

    - by DrDol
    I have a thread, that processes incomming messages (endless loop). For this, I use a BlockingQueue (Java), which works as quite nice. Now, I want to add a second processor in the same Class oder method. The problem now is, that in the endless loop i have this part newIncomming = this.incommingProcessing.take(); This part blocks if the Queue is empty. I'm looking for a solution to process to queues in the same class. The second queue can only processed, it some data is coming in for the first Queue. Is there a way to handle tow blocking queues in the same endless loop?

    Read the article

  • XPath ordered priority attribute search

    - by user94000
    I want to write an XPath that can return some link elements on an HTML DOM. The syntax is wrong, but here is the gist of what I want: //web:link[@text='Login' THEN_TRY @href='login.php' THEN_TRY @index=0] THEN_TRY is a made-up operator, because I can't find what operator(s) to use. If many links exist on the page for the given set of [attribute=name] pairs, the link which matches the most left-most attribute(s) should be returned instead of any others. For example, consider a case where the above example XPath finds 3 links that match any of the given attributes: link A: text='Sign In', href='Login.php', index=0 link B: text='Login', href='Signin.php', index=15 link C: text='Login', href='Login.php', index=22 Link C ranks as the best match because it matches the First and Second attributes. Link B ranks second because it only matches the First attribute. Link A ranks last because it does not match the First attribute; it only matches the Second and Third attributes. The XPath should return the best match, Link C. If more than one link were tied for "best match", the XPath should return the first best link that it found on the page.

    Read the article

  • Python/YACC Lexer: Token priority?

    - by Rosarch
    I'm trying to use reserved words in my grammar: reserved = { 'if' : 'IF', 'then' : 'THEN', 'else' : 'ELSE', 'while' : 'WHILE', } tokens = [ 'DEPT_CODE', 'COURSE_NUMBER', 'OR_CONJ', 'ID', ] + list(reserved.values()) t_DEPT_CODE = r'[A-Z]{2,}' t_COURSE_NUMBER = r'[0-9]{4}' t_OR_CONJ = r'or' t_ignore = ' \t' def t_ID(t): r'[a-zA-Z_][a-zA-Z_0-9]*' if t.value in reserved.values(): t.type = reserved[t.value] return t return None However, the t_ID rule somehow swallows up DEPT_CODE and OR_CONJ. How can I get around this? I'd like those two to take higher precedence than the reserved words.

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >