首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏Lansonli技术博客

    php – Laravel 7 Session Lifetime

    session.php /* |-------------------------------------------------------------------------- | Session Lifetime If you want them | to immediately expire on the browser closing, set that option. | */ 'lifetime' => session.cookie_lifetime – 默认值0 session.cookie_lifetime specifies the lifetime of the cookie in seconds

    1.5K40发布于 2021-10-09
  • 来自专栏Dotnet9

    (730)Blazor系列:生命周期(Lifetime)

    前面说过自己建立的Service都必须在Program.cs注册,但有些基本Service就不用自己做了。

    1.5K30编辑于 2021-12-15
  • 来自专栏青玉伏案

    ReactiveSwift源码解析(十) Lifetime代码实现

    一、Lifetime使用实例 针对Lifetime的特性,我们给出了下方的示例。当然ReactiveSwift官网上是没有关于Lifetime的单独示例的,因为Lifetime不单独的对外服务。 下方就是我们对Lifetime类而写的示例。 1、lifetime()方法实现 首先我们来看一下下方的lifetime()方法。。 因为lifetime对象除了在lifetime()方法中使用到,再也没有其他地方的引用了,根据ARC中Strong类型的特点,所以在lifetime()方法调用结束后lifetime对象就会被释放掉。 当lifetime()被调用后,因为lifetime()中的lifetime对象所对应的堆空间只用在lifetime()的作用域中被引用到,所以当该方法执行完毕后,lifetime所对应的堆空间会立即被释放掉 稍后,我们聊Token类以及Lifetime类时,会一目了然。 ? 二、Lifetime中的内部类Token 看完Lifetime的使用示例,我们来看一下Lifetime的内部代码实现。

    1.1K100发布于 2018-01-11
  • 来自专栏C++核心准则原文翻译

    C++核心准则​Pro.lifetime:生命周期安全群组

    Pro.lifetime: Lifetime safety profile Pro.lifetime:生命周期安全群组 Accessing through a pointer that doesn't https://github.com/isocpp/CppCoreGuidelines/blob/master/docs/Lifetime.pdf Lifetime safety profile summary (声明周期安全群组摘要): Lifetime.1: Don't dereference a possibly invalid pointer: detect or avoid. Lifetime.1:不要取消引用可能无效的指针:检测或避免。 语言规则避免未定义的行为 原文链接 https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#prolifetime-lifetime-safety-profile

    57320发布于 2020-11-11
  • 来自专栏CSDNToQQCode

    Rust专项——生命周期(Lifetime)详解:让引用始终有效

    生命周期(lifetime)是 Rust 用来在编译期证明“引用始终有效”的标注系统。它不改变运行时行为,但指导编译器确认:任何引用的生存期都不短于其使用范围,从而杜绝悬垂引用。

    53710编辑于 2025-12-16
  • 来自专栏Rust学习专栏

    Go的闭包看你犯错,但Rust的lifetime却默默帮你排坑

    arr的借用,这个借用后的结果i被let handle = thread::spawn(move 中的move关键字强制转移走了,因此在handle线程离开作用域之后就被释放了,而下次迭代时arr变量由于lifetime 为了更简要的说明这个问题我们来看下面的代码: fn main() { { let x; { let y = 5; x = &y;// x借用y的值 } // y在这里已经被释放,因此借用y的x也不能通过lifetime ("x: {}", x); } } x借用y的值,如果在y的lifetime以外,再出现x的访问就会出现问题。 ("{}", j); });//这里j超出lifetime就不会影响到i了 } thread::sleep(Duration::from_millis(10)); } 新添加的let j=i+1;

    65300发布于 2021-07-24
  • 来自专栏Hadoop实操

    0579-5.15.1-Java 应用程序中修改Kerberos ticket_lifetime参数无效异常分析

    和renew_lifetime 验证该参数的有效性,将ticket_lifetime 设置为20s,为了避免超时自动续期将renew_lifetime也设置为20S ticket_lifetime = 20s (默认值24h) renew_lifetime = 20s (默认值7d) ? 说明执行login.login()的时候就已经指定了凭证的有效期日期为1天,也就是程序并没有读取ticket_lifetime 和renew_lifetime 参数。 所以不论你krb5.conf 中是否有ticket_lifetime 和renew_lifetime 参数并不会改变凭证的有效时间。invoke() 函数如下: ? 为了验证程序并没有读取ticket_lifetime 和renew_lifetime 参数,我们使用设置系统参数的方式来验证,注释掉krb5.conf 文件然后执行。

    2K20发布于 2019-04-28
  • C++23 std::start_lifetime_as:用于隐式生存期类型的显式生存期管理函数 (P2590R2)

    二、std::start_lifetime_as 基本概念std::start_lifetime_as 是C++23标准库中定义于 <memory> 头文件的一个实用工具函数。 函数原型template< class T >T* start_lifetime_as( void* p ) noexcept;template< class T >const T* start_lifetime_as std::start_lifetime_as 的出现解决了这些问题,它提供了一种简洁、高效的方式来管理隐式生存期类型对象的生存期。1. 保持对象表示不变std::start_lifetime_as 在创建对象时,会保持对象的表示不变。 与 std::start_lifetime_as 的关联std::start_lifetime_as 主要用于隐式生存期类型的对象。

    26410编辑于 2025-05-26
  • 来自专栏along的开发之旅

    [C++模版] 判断函数入参是不是一个lambda

    template<typename T>struct manual_lifetime { manual_lifetime() noexcept = default; ~manual_lifetime () = default; // Not copyable/movable manual_lifetime(const manual_lifetime&) = delete; manual_lifetime (manual_lifetime&&) = delete; manual_lifetime& operator=(const manual_lifetime&) = delete; manual_lifetime & operator=(manual_lifetime&&) = delete; template<typename Factory> requires std

    4.5K40编辑于 2023-02-23
  • 来自专栏大内老A

    [ASP.NET Core 3框架揭秘] 依赖注入:一个Mini版的依赖注入框架

    ) .Register<IBar>(_=> new Bar(), Lifetime.Self) .Register<IBaz, Baz>(Lifetime.Root ) .Register<Base, Bar>(Lifetime.Transient) .Register<Base, Baz>(Lifetime.Transient public class ServiceRegistry { public Type ServiceType { get; } public Lifetime Lifetime { get lifetime) { cat.Register(new ServiceRegistry(typeof(TService), lifetime, (_,arguments)= Lifetime { get; } public MapToAttribute(Type serviceType, Lifetime lifetime) {

    1.7K20发布于 2019-10-23
  • 来自专栏明丰随笔

    IOC编程

    = AutowireAttribute.DEFAULT_LIFETIME_SCOPE; this.Priority = AutowireAttribute.DEFAULT_PRIORITY; DEFAULT_LIFETIME_SCOPE = Lifetime.Singleton; public const byte DEFAULT_PRIORITY = 100; public AutowireAttribute set; } public string Name { get; set; } public Lifetime Lifetime { get; set; } public byte Priority ) ); } } private ITypeLifetimeManager CreateLifetimeManager(Lifetime lifetime) { switch (lifetime) { case Lifetime.Transient: return this.

    88530发布于 2019-07-15
  • 来自专栏大内老A

    ASP.NET Core 6框架揭秘实例演示[04]:自定义依赖注入框架

    using App; var root = new Cat() .Register<IFoo, Foo>(Lifetime.Transient) .Register<IBar>(_ = > new Bar(), Lifetime.Self) .Register<IBaz, Baz>(Lifetime.Root) .Register(typeof(Foo).Assembly ) .Register<IBar, Bar>(Lifetime.Transient) .Register(typeof(IFoobar<,>), typeof(Foobar<,>), Lifetime.Transient ) .Register<Base, Bar>(Lifetime.Transient) .Register<Base, Baz>(Lifetime.Transient) .GetServices .Register<IBar>(_ => new Bar(), Lifetime.Self) .Register<IBaz, Baz>(Lifetime.Root)

    81540编辑于 2022-05-09
  • 来自专栏DotNet NB && CloudNative

    如何正确实现一个后台(定时)任务

    HostServiceTest_A is doing work. info: Microsoft.Hosting.Lifetime[14] Now listening on: http:// localhost:5221 info: Microsoft.Hosting.Lifetime[0] Application started. localhost:5221 info: Microsoft.Hosting.Lifetime[0] Application started. :5221 info: Microsoft.Hosting.Lifetime[0] Application started. :5221 info: Microsoft.Hosting.Lifetime[0] Application started.

    42210编辑于 2025-07-02
  • 来自专栏大内老A

    依赖注入[5]: 创建一个简易版的DI框架[下篇]

    如下所示的就是表示服务注册的ServiceRegistry的定义,它具有三个核心属性(ServiceType、Lifetime和Factory)分别代表服务类型、生命周期模式和用来创建服务实例的工厂。 lifetime, Func<Cat,Type[], object> factory) { ServiceType = serviceType; Lifetime ) { case Lifetime.Root: return GetOrCreate(_root. public static Cat Register<TFrom, TTo>(this Cat cat, Lifetime lifetime) where TTo:TFrom => cat lifetime) { cat.Register(new ServiceRegistry(typeof(TServiceType), lifetime, (_,arguments

    76240发布于 2018-08-01
  • 来自专栏博客园

    Core官方DI剖析(1)--ServiceProvider类和ServiceCollection类

    ` // 注册的类型的生命周期 /// <inheritdoc /> public ServiceLifetime Lifetime { get; } // 注册类型的基类型 /// = lifetime; ServiceType = serviceType; // 对内部维护的注册类型对象进行赋值 ImplementationInstance ) : this(serviceType, lifetime) { Lifetime = lifetime; ServiceType = serviceType; ) : this(serviceType, lifetime) { Lifetime = lifetime; ServiceType = serviceType; (serviceType, implementationType, lifetime); // 此方法只有Sinleton生命周期才能调用 public static ServiceDescriptor

    2.2K40发布于 2018-11-26
  • 来自专栏Hadoop实操

    0578-5.15.1-Kerberos环境下Java应用程序认证超时异常分析

    Ticket过期是由ticket_lifetime和renew_lifetime两个参数控制,具体分析如下: 先了解下krb5.conf里ticket_lifetime和renew_lifetime参数 : ticket_lifetime = 24h renew_lifetime = 7d 注:这里其实还跟kdc.conf里的ticket_lifetime和renew_lifetime相关,本文不做讨论 每一个Kerberos的ticket,包括TGT,都有一个ticket_lifetime(默认:1天);Ticket可以被延续,但最多只能延续到renew_lifetime(默认:7天),超过7天后无法再延续 那么,这些daemon进程为什么能在启动后长时间持续运行而不会出现kerberos ticket错误呢(甚至已经超过了renew_lifetime)?

    3.2K30发布于 2019-04-28
  • 来自专栏DotNet NB && CloudNative

    基于 keyed DI 的 HttpClient

    public static IHttpClientBuilder AddAsKeyed(this IHttpClientBuilder builder, ServiceLifetime lifetime 方法 public static IHttpClientBuilder AddAsKeyed( this IHttpClientBuilder builder, ServiceLifetime lifetime ); } public HttpClientKeyedLifetime(ServiceLifetime lifetime) : this(KeyedService.AnyKey, lifetime ) { } public HttpClientKeyedLifetime(string name, ServiceLifetime lifetime) : this((object)name, lifetime) { } public void AddRegistration(IServiceCollection services) { if (IsDisabled

    32400编辑于 2025-03-29
  • 来自专栏全栈程序员必看

    Unity中的Shuriken粒子系统(5)

    设置速度在生命周期内改变(曲线的设置) Velocity over Lifetime 1.在Velocity over Lifetime的Constant形式下,速度设置保持恒定。 通过Particle System中的Start Speed,只能设置粒子发射的起始速度,不能改变粒子发射过程中的速度;而Velocity over Lifetime能够改变粒子在运动过程中的速度。 2.点击Velocity over Lifetime右边的小三角,选择Curve形式,可以通过设置曲线来设置粒子的运动。 Velocity over Lifetime的Space有Local和World两种模式,Local模式下粒子的运动受自身旋转的影响,而World模式下,粒子的运动不受自身旋转的影响。 4.点击Velocity over Lifetime的Random Between Two Curves形式。

    1.1K40编辑于 2022-11-17
  • 来自专栏博客园

    Core官方DI剖析(1)--ServiceProvider类和ServiceCollection类

    ` // 注册的类型的生命周期 /// <inheritdoc /> public ServiceLifetime Lifetime { get; } // 注册类型的基类型 /// = lifetime; ServiceType = serviceType; // 对内部维护的注册类型对象进行赋值 ImplementationInstance ) : this(serviceType, lifetime) { Lifetime = lifetime; ServiceType = serviceType; ) : this(serviceType, lifetime) { Lifetime = lifetime; ServiceType = serviceType; (serviceType, implementationType, lifetime); // 此方法只有Sinleton生命周期才能调用 public static ServiceDescriptor

    1.4K10发布于 2018-12-18
  • 来自专栏深入理解Android

    Android Framework学习(六)之RefBase,SP,WP

    Flags for extendObjectLifetime() enum { OBJECT_LIFETIME_STRONG = 0x0000, OBJECT_LIFETIME_WEAK mFlags可以为0或以下枚举值: enum { OBJECT_LIFETIME_WEAK = 0x0001, OBJECT_LIFETIME_FOREVER = 0x0003 包含OBJECT_LIFETIME_WEAK(位运算中其二进制11包含01),所以当 refs->mFlags&OBJECT_LIFETIME_WEAK) ! allow = (impl->mFlags&OBJECT_LIFETIME_WEAK) == OBJECT_LIFETIME_WEAK && impl->mBase- 2.当flag为OBJECT_LIFETIME_WEAK时,实际对象的生命周期受弱引用数控制。 3.当flag为OBJECT_LIFETIME_FOREVER时,实际对象的生命周期由用户控制。

    1.2K32编辑于 2022-06-22
领券