Beispiel #1
0
        public async ValueTask Publish(byte[] bytes, string hashKey)
        {
            var route    = publisher.GetRoute(hashKey);
            var pullTask = PullModel(route);

            if (!pullTask.IsCompletedSuccessfully)
            {
                await pullTask;
            }
            pullTask.Result.Publish(bytes, publisher.Exchange, route, false);
        }
Beispiel #2
0
 public ValueTask Publish(byte[] bytes, string hashKey)
 {
     using var model = rabbitMQClient.PullModel();
     model.Publish(bytes, publisher.Exchange, publisher.GetRoute(hashKey), publisher.Persistent);
     return(Consts.ValueTaskDone);
 }