Ejemplo n.º 1
0
        public bool CanSend(TimeoutData data)
        {
            var hash = Hash(data);
            TimeoutDataEntity timeoutDataEntity;
            if (!TryGetTimeoutData(hash, out timeoutDataEntity)) return false;

            var leaseBlob = container.GetBlockBlobReference(timeoutDataEntity.StateAddress);

            using (var lease = new AutoRenewLease(leaseBlob))
            {
                return lease.HasLease;
            }
        }
Ejemplo n.º 2
0
        public bool CanSend(TimeoutData data)
        {
            TimeoutDataEntity timeoutDataEntity;

            if (!TryGetTimeoutData(data.Id, out timeoutDataEntity))
            {
                return(false);
            }

            var leaseBlob = container.GetBlockBlobReference(timeoutDataEntity.StateAddress);

            using (var lease = new AutoRenewLease(leaseBlob))
            {
                return(lease.HasLease);
            }
        }
        public bool CanSend(TimeoutData data)
        {
            var hash = Hash(data);
            var result = (from c in context.TimeoutData
                          where c.RowKey == hash
                          select c).SingleOrDefault();

            if (result == null) return false;

            var leaseBlob = container.GetBlockBlobReference(result.StateAddress);

            using (var lease = new AutoRenewLease(leaseBlob))
            {
                return lease.HasLease;
            }
        }
Ejemplo n.º 4
0
        public bool CanSend(TimeoutData data)
        {
            var context = new ServiceContext(account.TableEndpoint.ToString(), account.Credentials);
            TimeoutDataEntity timeoutDataEntity;

            if (!TryGetTimeoutData(context, data.Id, string.Empty, out timeoutDataEntity))
            {
                return(false);
            }

            var leaseBlob = container.GetBlockBlobReference(timeoutDataEntity.StateAddress);

            using (var lease = new AutoRenewLease(leaseBlob))
            {
                return(lease.HasLease);
            }
        }
Ejemplo n.º 5
0
        public bool CanSend(TimeoutData data)
        {
            var hash   = Hash(data);
            var result = (from c in context.TimeoutData
                          where c.RowKey == hash
                          select c).SingleOrDefault();

            if (result == null)
            {
                return(false);
            }

            var leaseBlob = container.GetBlockBlobReference(result.StateAddress);

            using (var lease = new AutoRenewLease(leaseBlob))
            {
                return(lease.HasLease);
            }
        }
Ejemplo n.º 6
0
        public bool CanSend(TimeoutData data)
        {
            var context = new ServiceContext(account.TableEndpoint.ToString(), account.Credentials);
            TimeoutDataEntity timeoutDataEntity;
            if (!TryGetTimeoutData(context, data.Id, string.Empty, out timeoutDataEntity)) return false;

            var leaseBlob = container.GetBlockBlobReference(timeoutDataEntity.StateAddress);

            using (var lease = new AutoRenewLease(leaseBlob))
            {
                return lease.HasLease;
            }
        }