生成带有效期鉴权的RTMP推流地址

@param streamKey          流名称
@param expireAfterSeconds 流过期时间，单位秒
5260
public String rtmpPublishUrl(String streamKey, int expireAfterSeconds) {
        long expire = System.currentTimeMillis() / 1000 + expireAfterSeconds;
        String path = String.format("/%s/%s?e=%d", hub, streamKey, expire);
        String token;
        try {
            token = auth.sign(path);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
        return String.format("rtmp://%s%s&token=%s", rtmpPublishDomain, path, token);
    }
203785
function(channel, numDays, next) {
    var filter,
      modelName = this.getDataSourceName('dup'),
      maxTime = (new Date()).getTime() - (numDays * 24 * 60 * 60 * 1000);

    if (channel) {
      filter = {
        channel_id : channel.id
      }
    }

    this._dao.expire(modelName, filter, maxTime, next);
  }
299209
public Long expireAt(Object key, long unixTime) {
		Jedis jedis = getJedis();
		try {
			return jedis.expireAt(keyToBytes(key), unixTime);
		}
		finally {close(jedis);}
	}
1111942
public static <T, C extends Collection<Timed<T>>> Function<Stream<Timed<T>>, Stream<C>> window(final int maxWindowSize, final Duration maxDuration,
            final LongSupplier startTime, final Supplier<? extends C> collectionSupplier) {
        return new Function<Stream<Timed<T>>, Stream<C>>() {
            @Override
            public Stream<C> apply(final Stream<Timed<T>> s) {
                final ObjIterator<C> iter = new ObjIteratorEx<C>() {
                    private long maxDurationInMillis;

                    private ObjIterator<Timed<T>> iter;
                    private Timed<T> next = null;

                    private long fromTime;
                    private long endTime;

                    private boolean initialized = false;

                    @Override
                    public boolean hasNext() {
                        if (initialized == false) {
                            init();
                        }

                        while ((next == null || next.timestamp() < endTime) && iter.hasNext()) {
                            next = iter.next();
                        }

                        return next != null && next.timestamp() >= endTime;
                    }

                    @Override
                    public C next() {
                        if (hasNext() == false) {
                            throw new NoSuchElementException();
                        }

                        fromTime = endTime;
                        endTime = fromTime + maxDurationInMillis;
                        int cnt = 0;
                        final C result = collectionSupplier.get();

                        if (next != null && next.timestamp() < endTime) {
                            result.add(next);
                            next = null;
                            cnt++;
                        }

                        if (next == null) {
                            while (cnt < maxWindowSize && iter.hasNext()) {
                                next = iter.next();

                                if (next.timestamp() < endTime) {
                                    result.add(next);
                                    next = null;
                                    cnt++;
                                } else {
                                    break;
                                }
                            }
                        }

                        endTime = N.min(endTime, next == null ? System.currentTimeMillis() : next.timestamp());

                        return result;
                    }

                    private void init() {
                        if (initialized == false) {
                            initialized = true;

                            N.checkArgNotNull(maxDuration, "maxDuration");
                            N.checkArgPositive(maxDuration.toMillis(), "maxDuration");
                            N.checkArgPositive(maxWindowSize, "maxWindowSize");
                            N.checkArgNotNull(startTime, "startTime");
                            N.checkArgNotNull(collectionSupplier, "collectionSupplier");

                            iter = s.iterator();

                            maxDurationInMillis = maxDuration.toMillis();

                            fromTime = startTime.getAsLong() - maxDurationInMillis;
                            endTime = fromTime + maxDurationInMillis;
                        }
                    }
                };

                return Stream.of(iter).onClose(new Runnable() {
                    @Override
                    public void run() {
                        s.close();
                    }
                });
            }
        };
    }
602186
@GuardedBy("evictionLock")
  void expireAfterWriteEntries(long now) {
    if (!expiresAfterWrite()) {
      return;
    }
    long duration = expiresAfterWriteNanos();
    for (;;) {
      final Node<K, V> node = writeOrderDeque().peekFirst();
      if ((node == null) || ((now - node.getWriteTime()) < duration)) {
        break;
      }
      evictEntry(node, RemovalCause.EXPIRED, now);
    }
  }
13250
public static QrcodeTicket qrcodeCreateTemp(String access_token,int expire_seconds,long scene_id){
		String json = String.format("{\"expire_seconds\": %d, \"action_name\": \"QR_SCENE\", \"action_info\": {\"scene\": {\"scene_id\": %d}}}",expire_seconds,scene_id);
		return qrcodeCreate(access_token,json);
	}
1281336
def expireat(self, key, when):
        """"""
        expire_time = datetime.fromtimestamp(when)
        key = self._encode(key)
        if key in self.redis:
            self.timeouts[key] = expire_time
            return True
        return False
285353
public Snapshot newTemporarySnapshot(long index, WallClockTimestamp timestamp) {
    SnapshotDescriptor descriptor = SnapshotDescriptor.builder()
        .withIndex(index)
        .withTimestamp(timestamp.unixTimestamp())
        .build();
    return newSnapshot(descriptor, StorageLevel.MEMORY);
  }
364915
public final UserManagedCacheBuilder<K, V, T> withExpiry(ExpiryPolicy<? super K, ? super V> expiry) {
    if (expiry == null) {
      throw new NullPointerException("Null expiry");
    }
    UserManagedCacheBuilder<K, V, T> otherBuilder = new UserManagedCacheBuilder<>(this);
    otherBuilder.expiry = expiry;
    return otherBuilder;
  }
361083
public Long expire(Object key, int seconds) {
		Jedis jedis = getJedis();
		try {
			return jedis.expire(keyToBytes(key), seconds);
		}
		finally {close(jedis);}
	}
364141
public static RetryPolicy defaultClientRetry(Duration maxRetryDuration, Duration baseSleepMs,
      Duration maxSleepMs) {
    return ExponentialTimeBoundedRetry.builder()
        .withMaxDuration(maxRetryDuration)
        .withInitialSleep(baseSleepMs)
        .withMaxSleep(maxSleepMs)
        .build();
  }
494984
public OneStepDistributedRowLock<K, C> expireLockAfter(long timeout, TimeUnit unit) {
        this.timeout      = timeout;
        this.timeoutUnits = unit;
        return this;
    }
354657
private void initBlkLocInfoExpireMap(long expireTime) {
    if (blkLocInfoExpireTimeout < 0) {
      return;
    }

    this.blkLocInfoExpireMap = new HashMap<LocatedBlock, Long>(this
        .getLocatedBlocks().size());
    for (LocatedBlock lb : this.getLocatedBlocks()) {
      blkLocInfoExpireMap.put(lb, expireTime);
    }
    timeBlkLocInfoExpire = expireTime;
  }
1374797
public String RTMPPlayURL(String domain, String hub, String streamKey) {
        return String.format("rtmp://%s/%s/%s", domain, hub, streamKey);
    }
1343664
public ActivityRecords history(String streamKey, long start, long end) throws QiniuException {
        if (start <= 0 || end < 0 || (start >= end && end != 0)) {
            throw new QiniuException(new IllegalArgumentException("bad argument" + start + "," + end));
        }
        String path = encodeKey(streamKey) + "/historyactivity?start=" + start;
        if (end != 0) {
            path += "&end=" + end;
        }
        return get(path, ActivityRecords.class);
    }
432046
public StoredChannel setExpiration(Long expiration) {
    lock.lock();
    try {
      this.expiration = expiration;
    } finally {
      lock.unlock();
    }
    return this;
  }
1304369
public boolean setExpire(long seconds) {
		if(seconds <= 0)return true;
		try {
			if(!isBinary)return getJedisCommands(groupName).expire(key, (int)seconds) == 1;
			if(isCluster(groupName)){
				return getBinaryJedisClusterCommands(groupName).expire(keyBytes, (int)seconds) == 1;
			}
			return getBinaryJedisCommands(groupName).expire(keyBytes, (int)seconds) == 1;
		} finally {
			getJedisProvider(groupName).release();
		}

	}