in Hybrid ECS, how can i design a system that run only once on a entity ?

let say i want a system to run only once on a entity. I need the entity to have the components the system requires in order to have the system do its jobs. But then, how can i remove the entity from the system when the task is complete ?
thanks !

Destroying entities in ComponentSystem is very simple:

PostUpdateCommands.DestroyEntity( entity );

It slightly more complicated in JobComponentSystem:

//Component data. Nothing new here:
[System.Serializable]
public struct Lifetime : IComponentData { public float seconds; }
public class LifetimeComponent : ComponentDataWrapper<Lifetime> {}

//Job. Here is where destroy command is buffered for execution:
[BurstCompile]
struct LifetimeJob : IJobProcessComponentDataWithEntity<Lifetime>
{
	[ReadOnly] public float deltaTime;
	[ReadOnly] public EntityCommandBuffer commands;
	public void Execute
	(
		Entity entity ,
		int index ,
		[ReadOnly] ref Lifetime lifetime
	)
	{
		if( lifetime.seconds>0f ) { lifetime.seconds -= deltaTime; }
		else { commands.DestroyEntity( entity ); }
	}
}

//System. You need to create a command buffer and pass it to job:
public class LifetimeSystem : JobComponentSystem
{
	[Inject] Barrier _barrier = null;
	protected override JobHandle OnUpdate ( JobHandle dependency )
	{
		var job = new LifetimeJob
		{
			deltaTime = Time.deltaTime ,
			commands = _barrier.CreateCommandBuffer()
		};
		return job.Schedule( this , dependency );
	}
}

I have absolutly no competences in JobComponentSystem so i will stick to ComponentSystem at the moment !

indeed, destroying entities seems pretty simple. But what happen to the gameObject this entity is attached to ?
Could i just write something like that ?

    protected override void OnUpdate()
    {
        //do initialisation things
        PostUpdateCommands.DestroyEntity( entity );
    }

or maybe

protected override void OnCreateManager()
    {
     //Do initialisation Thing
    }

    protected override void OnUpdate()
    {
        PostUpdateCommands.DestroyEntity( entity );
    }

thanks !