How to give a name in child specification supervisor

I made a function that runs as a process. If I start this process and then register it, then my app works fine. But if I run this process in child specifications, the app stops working. The process starts in both cases, but in the second case I can’t contact the process.

defp start_programm(conn_redis) do
pid = spawn_link(TaskTest.WorkWithRedis, :redis_put, [conn_redis])
Process.register(pid, :qqq)

children = [
  {
    Plug.Cowboy, 
    scheme: :http, 
    plug: TaskTest.Router, 
    options: [port: cowboy_port()]
  },
		%{
			id: ListKeysRedis,
			start: {TaskTest.ListKeysRedis, :start, []}
  } #,

%{

id: WorkWithRedis,

start: {TaskTest.WorkWithRedis, :redis_put, [conn_redis]},

name: Qqq

}

]

opts = [strategy: :one_for_one, name: TaskTest.Supervisor]

	Logger.info("Starting application...")

Supervisor.start_link(children, opts)

end

When I launch the app as above, everything works. But if I comment out the lines

pid = spawn_link(TaskTest.WorkWithRedis, :redis_put, [conn_redis])
Process.register(pid, :qqq)

and uncomment the commented out lines an error occurs when trying to send a message to the process.
How can I run a process under Supervisor and communicate with this process from any part of the code ?

The child spec does only define a child for a supervisor. It‘s not concerned with process registration. That‘s something the started child process itself would need to handle.

I think your answer is wrong. Or incomplete. While dealing with this issue, it turned out that when I run Supervisor like this:

defp start_programm(conn_redis) do
    children = [
      {
        Plug.Cowboy, 
        scheme: :http, 
        plug: TaskTest.Router, 
        options: [port: cowboy_port()]
     },
    %{
      id: ListKeysRedis,
      start: {TaskTest.ListKeysRedis, :start, []}
    },
    %{
      id: WorkWithRedis,
      start: {TaskTest.WorkWithRedis, :redis_put, [conn_redis]}
    }
  ]

  opts = [strategy: :one_for_one, name: TaskTest.Supervisor]

  Logger.info("Starting application...")

  Supervisor.start_link(children, opts)
end

that function redis_put from module TaskTest.WorkWithRedis (third child in children specification)
got a name TaskTest.Supervisor .
Using this name, I can access this function from anywhere in my code.
At the same time, the second child received a name TaskTest.ListKeysRedis .
It would be nice if someone explained how to assign names to children when starting Supervisor.