tagged [queue]

Fixed size queue which automatically dequeues old values upon new enqueues

Fixed size queue which automatically dequeues old values upon new enqueues I'm using `ConcurrentQueue` for a shared data structure which purpose is holding the last N objects passed to it (kind of his...

16 Feb at 10:24

"Cannot instantiate the type..."

"Cannot instantiate the type..." When I try to run this code: ``` import java.io.*; import java.util.*; public class TwoColor { public static void main(String[] args) { Queue theQueue = new Qu...

28 Apr at 05:43

Message Queue Exception : Queue does not exist or you do not have sufficient permissions to perform the operation

Message Queue Exception : Queue does not exist or you do not have sufficient permissions to perform the operation At this line of code i am getting the error as i mentioned I declared MSMQ_NAME as str...

2 May at 08:55

MessageQueue and Async / Await

MessageQueue and Async / Await I only want to receive my message in a async method! and its freezing my UI ``` public async void ProcessMessages() { MessageQueue MyMessageQueue = new MessageQueu...

19 Apr at 14:41

Is there a better way to wait for queued threads?

Is there a better way to wait for queued threads? Is there a better way to wait for queued threads before execute another process? Currently I'm doing: ``` this.workerLocker = new object(); // Global ...

2 Sep at 13:30

Priority queue in .Net

Priority queue in .Net I am looking for a .NET implementation of a priority queue or heap data structure > Priority queues are data structures that provide more flexibility than simple sorting, becaus...

Create Hash Value on a List?

Create Hash Value on a List? I have a `List` with 50 instances in it. Each of the instances has 1 or 2 unique properties, but in a way they are all unique because there is only one at position in the ...

2 Sep at 02:3

declaring a priority_queue in c++ with a custom comparator

declaring a priority_queue in c++ with a custom comparator I'm trying to declare a `priority_queue of nodes`, using `bool Compare(Node a, Node b)` as the comparator function (which is outside the node...

19 Apr at 18:33

Message Queue vs. Web Services?

Message Queue vs. Web Services? Under what conditions would one favor apps talking via a message queue instead of via web services (I just mean XML or JSON or YAML or whatever over HTTP here, not any ...

5 Mar at 01:21

C# Queue or ServiceBus with no dependencies?

C# Queue or ServiceBus with no dependencies? Is there a product (ideally open source, but not necessary), that would enable a zero dependency deployment? every service bus or queue library I've been a...

5 Feb at 21:31

How to post messages to an STA thread running a message pump?

How to post messages to an STA thread running a message pump? So, following [this](https://stackoverflow.com/questions/21451313), I decided to explicitly instantiate a COM object on a dedicated STA th...

23 May at 11:33

ServiceStack RedisMessageQueueClient strange behavior

ServiceStack RedisMessageQueueClient strange behavior My infrastructure: - - - In 'Main' AppHost I configure Redis manager: Then I run this code somewhere in service: ``` using (var client = new Redis...

29 Aug at 13:14

Why are Stack<T> and Queue<T> implemented with an array?

Why are Stack and Queue implemented with an array? I'm reading C# 4.0 in a Nutshell by the Albahari brothers and I came across this: > Stacks are implemented internally with an , as with Queue and Lis...

8 Jun at 19:3

Size-limited queue that holds last N elements in Java

Size-limited queue that holds last N elements in Java A very simple & quick question on Java libraries: is there a ready-made class that implements a `Queue` with a fixed maximum size - i.e. it always...

21 Aug at 21:42

How to create no-duplicates ConcurrentQueue?

How to create no-duplicates ConcurrentQueue? I need a concurrent collection that doesn't allow duplicates (to use in `BlockingCollection` as Producer/Consumer). I don't need strict order of elements. ...

ServiceStack Redis Mq Authentication

ServiceStack Redis Mq Authentication The way Service Stack lets me call existing Web Service endpoints from a message broker is fantastic. [https://github.com/ServiceStack/ServiceStack/wiki/Messaging-...

C#: Triggering an Event when an object is added to a Queue

C#: Triggering an Event when an object is added to a Queue `Queue` I created a new class that extends `Queue`: ``` public delegate void ChangedEventHandler(object sender, EventArgs e); public class Qu...

10 Feb at 08:16

How do I retrieve a list or number of jobs from a printer queue?

How do I retrieve a list or number of jobs from a printer queue? I'm looking for a way to get a list or number of jobs from a particular printer. In the best case I would want to have a "Job object" t...

13 Apr at 09:39

ServiceStack: Dependency injected object's lifetime in IMessageService

ServiceStack: Dependency injected object's lifetime in IMessageService We have logic that implements `IMessageService.RegisterHandler(Func, object>)`. In the execution block of the message queue, we a...

Efficient C# byte queue for parsing stream of bytes for binary message packets

Efficient C# byte queue for parsing stream of bytes for binary message packets I'm trying to replace what I would usually implement as a circular-buffer+. The function of the queue is to buffer incomi...

20 Jun at 09:12

How do I use ServiceStack.Redis message queue to send email notifications?

How do I use ServiceStack.Redis message queue to send email notifications? I am digging into the messaging capabilities of the ServiceStack.Redis client and trying to make sense of things. My initial ...

30 Mar at 17:47

Why doesn't Redis Pub / Sub allow access to Redis within the Callback?

Why doesn't Redis Pub / Sub allow access to Redis within the Callback? I am really stuck on this question regarding how to use Redis Pub / Sub (from ServiceStack, but I don't think it is just ServicSt...

Multithreaded .NET queue problems

Multithreaded .NET queue problems I'm have a wierd error in my code. It's extremely rare (happens once every few weeks maybe), but it's there and I'm not sure why. We have 2 threads running, 1 thread ...

25 Feb at 02:4

How would you obtain the first and last items in a Queue?

How would you obtain the first and last items in a Queue? Say I have a rolling collection of values where I specify the size of the collection and any time a new value is added, any old values beyond ...

20 Aug at 19:1

ServiceStack: replace a web service with a message queue

ServiceStack: replace a web service with a message queue I'm working on a project that provides some API for getting information about our partners' products. Every search request to our site has to m...

22 Aug at 10:8